Install Docker on Raspberry Pi

March 24, 2022

1. First things first, set up your Raspberry Pi

You can follow this guide to set up your Raspberry Pi to install anything on it.

2. Let’s get started, get the installer script

By running the following command you will be downloading an installer script to your home directory.

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

You can run the script with the following command.

sudo sh get-docker.sh

1 2

3. Add ‘pi’ user to the ‘docker’ group

This will allow us to run docker command without sudo

sudo usermod -aG docker pi

3

You should restart the Raspberry Pi with sudo reboot after this step.

4. Test your Docker installation

You can run an example Docker container with the following command. It will download (pull) and run the container.

docker run hello-world

4

5. Install Docker Compose on Raspberry Pi

In order to install Docker Compose on Raspberry Pi, you can use apt repositories as follows.

sudo apt install docker-compose

5

Have fun!


Profile picture

Written by Can Berk Durmus, a computer engineer. He uses OpenCV, CUDA, and QT with Python and C++. He feels comfortable around resource-limited tiny computers and autonomously flying robots.

© 2022