Install Docker on Raspberry Pi with one line command

📆 ·

The Command

Terminal window
sudo apt-get update && sudo apt-get upgrade -y && curl -fsSL https://get.docker.com | sudo sh && sudo usermod -aG docker $USER

Breakdown

Here’s the breakdown of it if you want to know what it does:

Terminal window
sudo apt-get update && sudo apt-get upgrade -y

This updates the package list and upgrades the packages on your Raspberry Pi.

Terminal window
curl -fsSL https://get.docker.com | sudo sh

This downloads the Docker installation script which is present at https://get.docker.com ↗️ and runs it with root privileges.

Note: Always check the script before running it with root privileges.

Terminal window
sudo usermod -aG docker $USER

This adds the current user to the docker group so you don’t have to use sudo every time you run docker.

You can also checkout the official documentation for installing Docker on Raspberry Pi at https://docs.docker.com/engine/install/raspberry-pi-os/ ↗️