Install Docker on Debian in Just 4 Easy Steps

DOCKER ON DEBIAN

This tutorial will briefly cover the exact steps to install docker on Debian. Docker is a service that runs software in virtually isolated containers. Containers are a standardized unit of software that allows developers to isolate their apps from their environment. This increases the portability of the code and reduces the challenges developers face while collaborating.

In this tutorial we will learn how to install Docker on Debian 10. Let’s go over it step by step.

Requirements:

  • 64-bit version.
  • Architectures supported : x86_64 (or amd64), armhf, and arm64

Steps to Install Docker on Debian

Now that we have the requirements in place, let’s get to installing the latest version of docker on Debian from the official docker repository.

1. Update APT and Download Dependencies

The first step is to use the apt command to update the repositories so we can get the latest packages and dependencies:

$ sudo apt-get update
Sudo Apt Update

This will update the package index. Next we need to install prerequisite packages to let apt use packages over HTTPS.

$ sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common
Install Packages

2. Add Docker Repositories to Debian APT Sources

Next, we will add the docker repository GPG key to our apt keys using the following command:

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

We will run the apt-key fingerprint command to confirm the correct fingerprint. The following is the fingerprint for the latest docker version on their official website:

$ sudo apt-key fingerprint 0EBFCD88
Docker Key

Finally, let’s add the repository to our Debian database to ensure that we can download the packages from the repo:

$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

The lsb_release -cs sub-command returns the name of your Debian distribution.

Docker Repo 1
Docker Repo 1

3. Installing Docker Engine

Let’s update the apt repositories again so we can get the packages from the docker repo that we just added.

 $ sudo apt-get update
Apt Update

Once we are done will all the steps above, we can finally go ahead and install Docker. For that run the command :

$ sudo apt install docker-ce

Press ‘y’ to process with the installation.

Installing Docker 1

4. Verify the Installation

To check if the installation was successful, run :

$ docker -v
Docker Version

This means you are all set to go and rock with your docker!

Conclusion

That’s about it. You now have a complete install of Docker on Debian. If you want to learn more about how to use Docker to spawn containers, you can view the Docker documentation.