I had some trouble finding a guide to getting Docker installed on a Raspberry Pi that was running the new Raspbian Buster release based on Debian 10. The install scripts links out there didn’t seem to want to work and many people had posted how to install the old Raspbian Stretch version. Since the Buster version of Docker had been realeased, I wanted to install it directly.

Install Docker

First, just for safe measure, remove any existing Docker apps.

$ sudo apt remove docker docker-engine docker.io containerd runc

If you haven’t attempted to install Docker, you may not have anything to remove…but you’ve probably tried the install from the old script or apt by the time you get here.

Now lets run the convience script available from Docker.

$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh

At this point you have Docker installed and can test the installation by running the Hello World image.

$ sudo docker run hello-world

Note: if you want to add the pi user to the docker permissions group run this command: $ sudo usermod -aG docker pi This isn’t nessary to control Docker from Portainer.

Install Portainer

Let’s leverage the easy of use of Docker and install a Docker image that will serve a web interface to manage Docker. Its as easy as running:

$ sudo docker volume create portainer_data
$ sudo docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

The image will be downloaded and started. You can now go to http://[Your Pi's IP]:9000 to access the inital setup. On the first screen you will need to set your password. Next, assuming you have done all of this on the same pi, select “local” and click “connect.”

Congrats! You’ve got Docker and Portainer setup on your Pi. Get some premade Docker images or roll your own to leverage the power of containerized application on your Pi.

Sources and Further Reading

Docker Documentation

Portainer Documentation