How to Install Docker CE on Debian 11

Install Docker CE on Debian 11

In this article, we will have explained the necessary steps to install Docker CE on Debian 11. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Docker is a free and open-source platform to develop, ship, and run applications in the containerized environment. It enables you to package and run your applications in isolated containers in a single server or cluster of Linux servers orchestrated by Kubernetes and similar tools.

Install Docker CE on Debian 11

Step 1. The first command will update the package lists to ensure you get the latest version and dependencies.

sudo apt update
sudo apt upgrade
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release

Step 2. Install Docker on Debian 11.

Use the command to add the Docker repository for Debian 11 system:

echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Then, add the GPG key from the repository:

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

Once done, refresh apt again and installing Docker on the system:

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

Verify the Docker CE version:

docker version

Output:

Client: Docker Engine - Community
 Version:           20.19.8
 API version:       1.46
 Go version:        go1.16.8
 Git commit:        5758b7d
 Built:             Mon Sep 16 13:46:11 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

After the installation is completed you can check the status of the docker service whether it’s running normally without generating errors:

sudo systemctl start docker

Step 3. Using Docker.

To search for an image from the Docker Hub registry, use the docker search command. For example, to search for a Ubuntu image:

docker search debian

For example, the following command will start a Docker container based on the Ubuntu image:

docker container run ubuntu

To list active Docker containers, use the following command:

docker container ls

That’s all you need to do to install the Docker CE on Debian (Bullseye). I hope you find this quick tip helpful. For further reading Docker container on Debian’s system, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.