How do I install Docker on Debian 12?
Install Docker Engine from the official repository and test the installation with hello-world.
Use Docker’s official repository to receive maintained versions. Avoid scripts copied from an unknown source.
Step-by-step procedure
-
Prepare the system
Update Debian and install repository tools and certificates.
-
Add Docker’s key
Download the official key to /etc/apt/keyrings, then add the Docker repository to Debian’s APT sources.
-
Install Docker Engine
Install Docker Engine, the Buildx plugin and Docker Compose.
-
Test the installation
Run docker run --rm hello-world, then check that the service starts when the system boots.