
Docker is a containerization platform. It allows the developers to package the applications along with the necessary dependencies into the lightweight, isolated containers. This method ensures consistency and portability across different environments. Docker’s efficient containerization minimizes the overhead of virtualization, making it ideal for deploying the applications from the local development environments to the cloud infrastructures. With Docker, the developers can easily share, distribute, and scale the applications. This streamlines the development process and promotes DevOps practices. Its vast ecosystem of pre-built images and Docker Hub repository facilitates rapid application deployment and fosters collaboration among developers. This makes Docker an essential tool in the modern software development.
In this article, we will show you how to install the latest version of Docker CE on Debian 12 “Bookworm”.
Topic of Contents:
- Updating the Debian 12 Package Database Cache
- Removing the Conflicting Docker Packages from Debian 12
- Installing the Prerequisite Packages on Debian 12
- Installing the GPG Key of the Official Docker Repository on Debian 12
- Adding the Official Docker Package Repository on Debian 12
- Installing Docker CE on Debian 12
- Adding a Debian 12 Login User to the Docker Group
- Checking If Docker and Docker Compose Are Accessible on Debian 12
- Conclusion
Updating the Debian 12 Package Database Cache
To update the Debian 12 package database cache, run the following command:
MY LATEST VIDEOS
Removing the Conflicting Docker Packages from Debian 12
If you installed Docker from the official Debian 12 package repository already, you must uninstall/remove them before installing the Docker from the official Docker package repository. This is to make sure that the Debian-packaged version of Docker does not conflict with the official Docker-packaged version of Docker.
To remove the conflicting Docker packages from Debian 12, run the following command:
In our case, no conflicting Docker packages are installed. If you have any, it will be removed.
Installing the Prerequisite Packages on Debian 12
To install the official Docker package repository on Debian 12, you need to install some packages on your Debian 12.
You can install the required packages with the following command:
To confirm the installation, press Y and then press <Enter>.
The required packages should be installed.
Installing the GPG Key of the Official Docker Repository on Debian 12
Before you can add the official Docker package repository to your Debian 12 system, you must install the GPG key of the official Docker repository on your Debian 12 system.
To make sure that the /etc/apt/keyrings directory has the correct access permissions, run the following command: