How to Install Docker on Debian 11

Docker is a platform for building, shipping, and running applications in containers. In this tutorial, we will guide you through the process of installing Docker on Debian 11.

3 mins read

0 views

Not using Debian 11?

Choose a different version or distribution.

Step 1: Update the System

Before installing Docker on Debian 11, it's recommended to update the system packages to their latest versions. Open the terminal and run the following command:

sudo apt-get update

Step 2: Install Dependencies

To install Docker on Debian 11, you need to install some dependencies first. Run the following command to install the required dependencies:

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

Step 3: Add Docker Repository

To install the latest version of Docker on Debian 11, you need to add the Docker repository to the system. Run the following command to add the Docker repository:

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

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

Step 4: Install Docker

After adding the Docker repository, you can now install Docker by running the following command:

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

Step 5: Start and Enable Docker

Once Docker is installed, you can start and enable the Docker service using the following commands:

sudo systemctl start docker
sudo systemctl enable docker

Step 6: Verify Docker Installation

To verify that Docker is installed correctly on Debian 11, run the following command:

sudo docker run hello-world

If Docker is installed correctly, you should see a "Hello from Docker!" message in the output.

Conclusion

In this tutorial, we have shown you how to install Docker on Debian 11. Docker is a powerful tool for building and deploying applications in containers, and it's a popular choice among developers and DevOps professionals. With Docker, you can easily package your applications and dependencies into containers, making it easier to deploy and manage your applications.