How to Docker on Raspberry PI (Raspbian)

Docker Logo

If you like tinkering with Docker and have a Raspberry PI available, you’re in luck! You can now install Docker on your RPI without messing with complicated stuff, fire up a terminal and follow this tutorial.

Prerequisites

Important
I take absolutely NO responsibility of what you do with your machine; use this tutorial as a guide and remember you can possibly cause data loss if you touch things carelessly.

In order to follow this tutorial you will need:

  • A Raspberry PI with Raspbian Wheezy, Jessie, Stretch or superior.
  • Administrator privileges
  • About 10 minutes if you have a fast connection.

Setting up the required software

In this step we’re going to install the required software in order to set up the Docker repository correctly and safely:

Rasbpian 7/8/9
$ sudo apt-get install \
     apt-transport-https \
     ca-certificates \
     curl \
     gnupg2 \
     software-properties-common

Now it is time to acquire the GPG key:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

If you want to check the fingerprint here it is for reference (if you don’t trust me, and that’s perfectly fine, verify on the official website): 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88.

Add the repository

In this step we’re going to add the repository:

Rasbpian 7/8/9
$ echo "deb [arch=armhf] https://download.docker.com/linux/debian \
     $(lsb_release -cs) stable" | \
     sudo tee /etc/apt/sources.list.d/docker.list

Install Docker CE

And finally:

Rasbpian 7/8/9
sudo apt-get update
sudo apt-get install docker-ce
systemctl enable --now docker

And voilà! You now have installed Docker on your Raspberry PI! You can continue your reading about Docker here:

Image courtesy of mark | marksei
mark

You may also like...

4 Responses

  1. Michael A Cooper says:

    Just an FYI this also works on Raspbian 9 I just performed this on 4 new Raspberry PI model 3’s with Raspbian lite 9 on them I believe the code name is stretch.

    • mark says:

      Thank you for the information, I’ve quickly reviewed the procedure on Raspbian 9 Stretch and can confirm everything is working fine for me. That said I’m updating the guide.

      • Michael A Cooper says:

        Hey Mark,
        The last part of your article where you say “and finally” does not have the Raspbian 7/8/9 like you changed earlier. Sorry not trying to call you out just thought you might have overlooked it.

        Thanks for the awesome article.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: