DEV Community

Cover image for How to Install Docker on Raspberry Pi 4 with Raspbian Buster
Wael Ramadan
Wael Ramadan

Posted on

How to Install Docker on Raspberry Pi 4 with Raspbian Buster

This is a simple guide to creating a Docker development environment with your Raspberry Pi 4.

This has been tested on a Raspberry Pi 4 Model B Rev 1.1 using Raspbian Buster.

You can check your Raspberry Pi model by running the following command in the Raspberry Pi terminal:

cat /proc/cpuinfo
Enter fullscreen mode Exit fullscreen mode

Check cpu info in raspbian

You can also check your Raspbian OS version by running the following command in the Raspberry Pi terminal:

cat /etc/os-release
Enter fullscreen mode Exit fullscreen mode

Check OS info in raspbian


Steps

  1. Install Docker
curl -sSl https://get.docker.com | sh
Enter fullscreen mode Exit fullscreen mode
  1. Install dependencies
sudo apt-get install -y python python-pip

sudo apt-get install libffi-dev libssl-dev
Enter fullscreen mode Exit fullscreen mode
  1. Add permissions for Pi User to run Docker Commands
sudo usermod -aG docker $USER
Enter fullscreen mode Exit fullscreen mode
  1. Install Docker Compose
sudo pip install docker-compose

Enter fullscreen mode Exit fullscreen mode
  1. Test Docker installation
docker run hello-world
Enter fullscreen mode Exit fullscreen mode

Note: you might need to restart your Raspberry Pi to use docker without sudo persissions.

docker hello-world

If the installation was completed successfully, you will get the "Hello from Docker!" message. You can then check out Docker Hub for arm based images to run on your Raspberry Pi.

Latest comments (0)