How to install Docker & Docker compose on Debian 12, how do you do that?
How to install Docker in Debian Linux 12
What is Docker?
Docker is an open-source platform that makes it easy to package software into containers. Each container contains all the necessary components—such as code, libraries, and settings—so you can quickly and consistently deploy your applications across environments.
What can you do with it?
With Docker, you don’t have to worry about versions or dependencies clashing because each container runs in its own isolated environment. Whether you want to develop locally, scale in the cloud, or even deploy Docker containers within Proxmox (LXC) environments, Docker makes managing and scaling your software a lot easier. This allows you to test new applications faster and ensure your applications run reliably everywhere.
Step 1 - Update your system
First update the package sources and installed packages:
apt update && apt upgrade -y
Step 2 - Install required packages
Install the necessary packages for adding the Docker repository:
apt install -y ca-certificates curl gnupg
Step 3 - Add the Docker GPG key
Create the folder for the keyring and add the GPG key:
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
Step 4 - Add the Docker repository
Configure the Docker repository:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" > /etc/apt/sources.list.d/docker.list
Step 5 - Install Docker
Update the package list and install Docker with the required components:
apt update
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Step 6 - Check the installation
Check that Docker is installed correctly by running a test container:
docker run hello-world
Check the Docker Compose version:
docker compose version
=> You should now have successfully installed Docker and Docker Compose on Debian 12..
This brings us to the end of this step-by-step plan, I hope you found it useful!