25/07/2020

3 Steps to install Docker on Raspberry Pi 4

By snorlaxprime

Docker is a tool that allows you to deploy application inside a software containers. This is good especially for Raspberry Pi because you can easily package the application and deploy that in many places.

So let’s get started

Step 1. Install using the shell script

Terminal service to your Raspberry Pi and then execute the following command

curl -sSL https://get.docker.com | sh

Once the script is complete, you should see something similar to the following:

Step 2. add pi user to the docker group

You will need to add the pi user to the docker group to allow it to run docker command, otherwise you will get an error. So execute the following

sudo usermod -aG docker pi

Then you can verify that user pi is now part of docker group with the following command

groups pi

You should see docker in the list.

Step 3. Now you can test docker

You will need to restart for the command in Step 2 to take affect, or you will still get the error message. If you don’t want to restart just prefix the command with sudo

docker run hello-world

if all goes well, you should see the following message

That’s all, the next post will be about how to run home assistant in docker.