How to Install Docker on Debian 12

This article will show you how to Install Docker on Debian 12 Bookworm. Docker is a widely used containerization platform that is well-supported on the Debian operating system. Docker in Debian allows developers and system administrators to easily package, distribute, and run applications and their dependencies within lightweight containers. These containers are isolated, making it a convenient solution for managing and deploying applications in a consistent and reproducible manner. Whether you’re looking to streamline software deployment or create a development environment that closely mirrors production, Docker on Debian provides an efficient and reliable solution for containerizing applications and services.

Steps to Install Docker on Debian 12

Step 1. Install Prerequisites

Connect to your Debian locally or remotely via SSH and then execute this command to install some packages below

apt update
apt install apt-transport-https ca-certificates curl gnupg 

Step 2. Add Docker Repository

Now we need to add the Docker repository to Debian 12

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Step 3. Install Docker

Now we are ready to install Docker

apt update
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin

Once complete, we can start and check the Docker service status

systemctl start docker
systemctl status docker

Make sure the Docker service status is active as shown in the picture below

Install Docker on Debian 12

At this point, we have successfully install Docker on our Debian system. Now we can start using Docker. For example, we will run the hello world.

docker run hello-world

Thanks for reading and see you next.