How to Install Docker on Debian 13 (Trixie)

By 

Updated on

7 min read

Install Docker on Debian 13 Trixie

Docker is an open-source containerization platform for building, testing, and running applications in containers. On Debian 13, the safest way to install Docker Engine is to use Docker’s official APT repository instead of the older docker.io package from the Debian repositories.

This tutorial explains how to install Docker on Debian 13 (Trixie), verify the service, install the Docker Compose plugin, and fix the most common repository, keyring, and service errors.

Quick Reference

TaskCommand
Check Debian codename. /etc/os-release && echo "$VERSION_CODENAME"
Install Dockersudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Start Docker servicesudo systemctl start docker
Check Docker service statussudo systemctl status docker
Check Docker versionsudo docker version
Run test containersudo docker run hello-world
Add user to docker groupsudo usermod -aG docker $USER
List available Docker versionsapt list --all-versions docker-ce
Update Dockersudo apt update && sudo apt upgrade
Hold Docker versionsudo apt-mark hold docker-ce
Stop all containersdocker container stop $(docker container ls -aq)
Remove all Docker objectsdocker system prune -a --volumes -f
Uninstall Dockersudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Prerequisites

Before you begin, make sure that:

  • You are running a 64-bit Debian 13 system.
  • You have a user account with sudo privileges .
  • Your system is connected to the internet and up to date.

Docker is available in the default Debian repositories, but those packages are often outdated. To get the latest stable version, install Docker from the official Docker repository.

Uninstall any old or conflicting Docker packages first:

Terminal
sudo apt remove docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc

It is fine if apt reports that none of these packages are installed.

Installing Docker on Debian 13

The installation involves adding the Docker repository, importing the GPG key, and installing the Docker packages.

Step 1: Update the Package Index and Install Dependencies

Update the package index and install the packages required to add repositories over HTTPS:

Terminal
sudo apt update
sudo apt install ca-certificates curl

Step 2: Import Docker’s Official GPG Key

Add Docker’s official GPG key so your system can verify package authenticity:

Terminal
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

Step 3: Add the Docker APT Repository

Add the Docker repository to your system:

Terminal
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF

On Debian 13, $(. /etc/os-release && echo "$VERSION_CODENAME") returns trixie. If you are installing Docker on a Debian derivative, replace that value with the matching Debian codename.

Step 4: Install Docker Engine

Update the package index and install Docker:

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

Installing a Specific Docker Version (Optional)

To install a specific Docker version instead of the latest one, first list the available versions:

Terminal
sudo apt update
apt list --all-versions docker-ce

The available Docker versions are printed in the second column:

output
docker-ce/trixie 5:<VERSION>-1~debian.13~trixie amd64
docker-ce/trixie 5:<VERSION>-1~debian.13~trixie amd64
docker-ce/trixie 5:<VERSION>-1~debian.13~trixie amd64
...

Install a specific version by adding =<VERSION> after the package name.

For example, set a variable from the version list and then install it:

Terminal
DOCKER_VERSION="<VERSION>"
sudo apt install docker-ce=$DOCKER_VERSION docker-ce-cli=$DOCKER_VERSION containerd.io docker-buildx-plugin docker-compose-plugin

Replace <VERSION> with the exact version string returned by apt list --all-versions docker-ce.

Verify the Docker Installation

On most Debian systems, the Docker service starts automatically after installation. If it does not, start it manually:

Terminal
sudo systemctl start docker

Check the service status:

Terminal
sudo systemctl status docker

The output will look something like this:

output
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled)
   Active: active (running)
...

You can also confirm that the Docker client and daemon are responding:

Terminal
sudo docker version

To verify that Docker can pull and run containers correctly, run the test image:

Terminal
sudo docker run hello-world

If the image is not found locally, Docker will download it from Docker Hub, run the container, print a “Hello from Docker” message, and exit.

output
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
...
Hello from Docker!
This message shows that your installation appears to be working correctly.
...

The container stops after printing the message because it has no long-running process.

Run Docker Commands Without sudo

By default, only root and users with sudo privileges can run Docker commands.

To allow a non-root user to execute Docker commands, add the user to the docker group:

Terminal
sudo usermod -aG docker $USER

$USER is an environment variable that holds the currently logged-in username. To add a different user, replace $USER with the username.

Run newgrp docker or log out and log back in for the group membership change to take effect.

After the group membership is active, rerun the test container without sudo :

Terminal
docker run hello-world

If the command works without sudo, your user has access to the Docker socket.

Updating Docker

When a new Docker version is released, update it using standard system commands:

Terminal
sudo apt update
sudo apt upgrade

To prevent Docker from being updated automatically, mark it as held:

Terminal
sudo apt-mark hold docker-ce

Uninstalling Docker

Before uninstalling Docker, it is a good practice to remove all containers, images, volumes, and networks .

Stop all running containers and remove all Docker objects:

Terminal
docker container stop $(docker container ls -aq)
docker system prune -a --volumes -f

Remove Docker packages:

Terminal
sudo apt purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras
sudo apt autoremove

To completely remove Docker data from your system, delete the data directories:

Terminal
sudo rm -rf /var/lib/{docker,containerd}

Remove the Docker repository and keyring if you do not plan to install Docker again:

Terminal
sudo rm -f /etc/apt/sources.list.d/docker.sources
sudo rm -f /etc/apt/keyrings/docker.asc

Troubleshooting

Package 'docker-ce' has no installation candidate
The Docker repository is missing, the Debian codename is wrong, or sudo apt update was not run after adding the repository. Check /etc/apt/sources.list.d/docker.sources, confirm that Suites: is set to trixie, and run sudo apt update again.

The repository ... does not have a Release file
This usually happens when the repository URL or codename is wrong. For Debian 13, URIs: must be https://download.docker.com/linux/debian and Suites: must be trixie. Do not use the Ubuntu Docker repository on Debian.

GPG or NO_PUBKEY errors during apt update
Recreate the keyring file and make it readable:

Terminal
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo apt update

Cannot connect to the Docker daemon
The Docker service is not running, or your user does not have access to the Docker socket. Start the service with sudo systemctl start docker, then check it with sudo systemctl status docker.

permission denied while trying to connect to the Docker daemon socket
Your user is not in the docker group, or the group change has not taken effect. Run sudo usermod -aG docker $USER, then log out and back in or run newgrp docker.

Docker and nftables firewall rules do not behave as expected
Docker works with iptables-nft and iptables-legacy. Firewall rules created directly with nft are not supported by Docker. If you manage firewall rules manually, check which iptables backend your system uses before changing Docker networking rules.

FAQ

Can I install Docker from the default Debian repositories?
Yes, but the version in the Debian repositories is often outdated. The official Docker repository provides the latest stable release with security updates.

Does Docker support Debian 12 (Bookworm) and Debian 11 (Bullseye)?
Yes. Docker officially supports Debian 13 (Trixie), Debian 12 (Bookworm), and Debian 11 (Bullseye). The installation steps are the same; only the codename in the repository configuration changes.

What is the difference between docker-ce and docker.io?
docker-ce (Community Edition) is the official package from Docker, Inc. maintained in their own repository. docker.io is the package maintained by the Debian project. docker-ce is updated more frequently and is the recommended choice.

How do I check which Docker version is installed?
Run docker version to see both the client and server versions.

Is Docker Compose included?
Yes. The docker-compose-plugin package is installed alongside Docker Engine. Use docker compose (without the hyphen) to run Compose commands.

Is this the same as Docker Desktop for Debian?
No. This guide installs Docker Engine for servers and command-line use. Docker Desktop is a separate desktop application with its own requirements and installer.

Conclusion

Installing Docker on Debian 13 from Docker’s official repository gives you current Docker Engine, CLI, Buildx, containerd, and Compose plugin packages through APT. After installation, verify the service with docker version and hello-world, then add your user to the docker group if you want to run Docker without sudo.

For advanced configuration, check the official Docker post-install guide .

Linuxize Weekly Newsletter

A quick weekly roundup of new tutorials, news, and tips.

About the authors

Dejan Panovski

Dejan Panovski

Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page