How to install Docker on a Raspberry PI

Many small board computers (SBC) you can run different tools & services for you. Especially any SBC with 2GB (or more). Like the Raspberry PI 4 with 4GB. To containerize all your stuff many people use Docker. In this blog I am going to talk about setting up a Docker instance on a Raspberry PI 4.


Summary

In this blog we are going to install docker on a Raspberry PI 4 who is running Ubuntu 20.04. When we have successfully installed docker we are also going to validate if docker is right installed.


Prerequisites

  • Raspberry PI 4 (preferred with 2 GB or 4 GB)
  • Micro SD card with 16GB or more
  • Ubuntu 20.04 installed
  • Basic knowledge about:
    • Putty
    • Docker

How to install docker on Ubuntu 20.04 on a Raspberry PI

To install docker on Ubuntu 20.04 on a Raspberry PI, you need to do the following steps:

  • Open putty and connect to your raspberry pi
  • Run the command “sudo apt install docker.io -y”. This will download and install docker.
  • Run the command “sudo usermod -aG docker $USER”. This will give the current user docker rights.
  • To make the right effective, you have to restart the raspberry pi. You can do this with the command “sudo reboot now”

Validate the installation of docker

You can validate the installation of docker with the following commands:

  • “docker version” – This will show the version of docker.
  • “docker info” – This will show the info of docker.
  • “docker run hello-world” – This will show the example container Hello World.

© 2024 Johan the Developer . Powered by WordPress. Theme by Viva Themes.