This guide describes how to install the Docker Engine on Debian 12 (Bookworm) and configure it so that it starts automatically as a system service and remains updatable via APT.
System update
Before installation, a complete update of all existing packages is recommended to avoid version conflicts.
Required tools
ca-certificates provides the certificates of trusted issuers.
curl is used to download the Docker GPG key.
gnupg converts the key into a format readable by APT.
Creating the keyring directory
APT stores repository keys since Debian 12 in the directory /etc/apt/keyrings
The directory is created with the correct permissions:
The permissions 0755 allow read access for everyone, write access remains restricted to root.
Adding the official Docker GPG key
The key is downloaded over a secure HTTPS connection.
gpg –dearmor converts it into the binary format that APT understands.
chmod a+r ensures that APT can read the key.
Adding the Docker repository
This entry adds the stable Docker repository.
arch specifies the architecture (e.g., amd64),
signed-by binds the key specifically to this repository.
Update package lists again
In the output, a line should appear such as:
Install Docker
| Package | Description |
|---|---|
| docker-ce | main service (dockerd) |
| docker-ce-cli | command-line tool |
| containerd.io | container runtime |
| docker-buildx-plugin | advanced build feature (BuildKit) |
| docker-compose-plugin | multi-container management |
Enable and start the service
Functionality test
