Install Docker on Raspberry Pi

2 minutes read

What is docker ?

Docker is similar to a virtual machine. However the difference is that it is a small container which just has enough resources and libraries to run the intended software. It is really interesting as you can make and install software on a docker, export the image and run it in any environment whether linux, mac or windows. Additionally you can upscale and downsize the application just by running multiple docker instances of the same application.

Docker was usually designed to run on a linux machine but now there are many professional barebone systems which are only designed to run docker (For example Kuberneties). Many big tech companies such as google and amazon provide Kuberneties and docket support on their cloud to run your applications.

Docker is very useful to design some highly scalable applications. Developers need not to worry about the system preferences while working on docker, and such individuals are called DevOps(Development + operations) engineers.

Therefore in this blog let we will discuss how to run docker on a Raspberry Pi. By this we can get taste of docker and run are applications as docker images. Simultaneously it will also give us a tremendous experience for working with docker professionally.

Install Docker on Raspberry Pi

Let us first update and upgrade our system.

sudo apt-get update && sudo apt-get upgrade -y
Update and Upgrade
Update and Upgrade

Installing Docker

For Raspberry Pi we should install it with a script as there is no repository support for Raspbian OS(By official docker documentation).

Note :- Please check the script before installing it on your system.

curl -fsSL https://get.docker.com -o get-docker.sh
cat get-docker.sh #check the script
sudo sh get-docker.sh
Install_Docker
Install Docker

Use Docker without root

By default only the root user is allowed to use docker. Please add your user to the docker group. After this you can use softwares within docker which require root access.

sudo usermod -aG docker <user-name>

Add User
Add User

Now logout and login again to make the changes effective.

Upgrading docker

We can update docker by the repository. There is no need to run the script again. Therefore let us add the docker in our local update repository.

echo "deb [arch=armhf] https://download.docker.com/linux/debian \
     $(lsb_release -cs) stable" | \
    sudo tee /etc/apt/sources.list.d/docker.list
ADD_Repo
Adding Repository

Now run the update command to make the changes effective

sudo apt-get update && sudo apt-get upgrade -y
update_and_upgrade
Update and Upgrade

We have successfully installed Docker. Have fun installing your softwares in docker and keep them as a docker images, no need to install them again and again. And the fun part is you may take the same docker image and even run those on raspnberry pi, mac or windows, which has docker installed on it.

Reference – https://docs.docker.com/install/linux/docker-ce/debian/

4 Replies to “Install Docker on Raspberry Pi”

  1. I have a few lessons that work with this. With your permission…?

    1. Sure please let me know.

  2. I am a little confused because of this evidence?

    1. What evidence are you talking about ?

Leave a Reply