Install Docker on a Raspberry Pi 4

Add your new user to the sudo group

sudo usermod -aG sudo g1

Update the apt package index & Upgrade all current program package

sudo apt-get update
sudo apt-get upgrate

Install packages to allow apt to use a repository over HTTPS:

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

Add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo apt-key add -

look up the name of your linux distribution

lsb_release -cs

Setup the Docker Repo.

sudo su
echo "deb [arch=armhf] https://download.docker.com/linux/raspbian buster stable" > /etc/apt/sources.list.d/docker.list
exit

Update the apt package index.

sudo apt-get update

Install the latest version of Docker Engine – Community and containerd without AUFS

sudo apt-get install --no-install-recommends docker-ce docker-ce-cli containerd.io

Show Docker Version

sudo docker version

Verify that Docker Engine – Community is installed correctly by running the hello-world image.

sudo docker run hello-world

Give the ‘g1’ user the ability to run Docker.

sudo usermod -aG docker g1

Leave a Reply