How to Install Docker on Your Raspberry Pi

How to Install Docker on Your Raspberry Pi
Tyler Tyler (285)
Total time: 15 minutes 

Docker is a tool that allows you to deploy applications inside of software containers. This can be useful for the Raspberry Pi because it allows users to run applications with very little overhead, as long as the application is packaged inside of a Docker image. You simply install Docker and run the container. This guide will walk you through the process of installing Docker on any version of Raspbian.

Posted in these interests:

12 guides
213 guides

We can easily install docker using a shell script provided by (none other than) docker.

curl -sSL | sh

If you prefer to inspect scripts before executing them, you can split this command into two pieces:

curl -sSL -o

# Make sure looks right


If you try to run some docker commands, you'll notice a "permission denied" error, which indicates docker can only be run by the root user (using sudo). If you would like to run docker commands as your non-root user (default is pi), you can run the following:

sudo usermod -aG docker pi

The usermod command with -aG will append (-a) the user to the groups (-G). In the above case, we are adding the pi user to the docker group. This enabled pi to run docker commands. You can obviously substituted any user if you are not using the default pi user.

You can verify this with the following command:

groups pi

Ensure docker is listed as one of the groups.

To test docker, we'll run the hello-world image.

docker run hello-world

If Docker is installed properly, you'll see a "Hello from Docker!" message.