Installing Docker on Raspberry Pi

docker

To install Docker on Raspberry PI, run the following commands:

sudo apt-get install apt-transport-https ca-certificates software-properties-common -y

curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

sudo usermod -aG docker pi

sudo curl https://download.docker.com/linux/raspbian/gpg

Then edit sources.list

sudo nano /etc/apt/sources.list

and add the following line at the end:

deb https://download.docker.com/linux/raspbian/ buster stable

Make sure to replace your version name (buster above) with the correct one.

Patch and update OS:

sudo apt-get update
sudo apt-get upgrade -y

and start Docker service:

sudo systemctl start docker.service

Reboot pi and when it comes back online, run the line below to test the installation:

docker info

It should print diagnostic information about Docker.

Installing Docker Compose

The commands above don’t install Docker Compose so in order to install that run the commands below:

First the dependencies:

sudo apt-get install libffi-dev

sudo apt-get install -y python python-pip

Then Docket compose:

sudo pip install docker-compose

Resources