How to Install Docker on Debian 13 (Trixie)

Debian is one of the most well-known and respected names in the Linux world, which doesn’t need much of an introduction. As a general-purpose distribution, it’s built a rock-solid reputation for stability and reliability, making it a go-to choice for millions of people from regular home users to large enterprises.

Now let's get started with the installation guide. First, refresh the packages on your Debian 13 system to ensure you’re using the latest software versions available in the distro’s repos. If there are pending updates, apply them.

sudo apt update

Next is to update the package index and install the prerequisites necessary to add and use a new HTTPS repository.

sudo apt install apt-transport-https ca-certificates curl gpg

So, let’s now import the Docker GPG repository key. The command below downloads and stores it in a format that the APT package manager can use to verify Docker packages. This security feature ensures that the software you’re installing is authentic.

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg

With the GPG key imported, it’s time to add the official Docker repository to our Trixie system so you can install and update Docker directly from upstream’s maintained DEB packages.

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian trixie stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

As with the previous command, its execution produces no output. Then refresh your package list so the package manager knows about the new repository.

sudo apt update

Additionally, you can also use the command below to verify that the Docker repo was properly added.

apt-cache policy

Finally, run the following command to install the latest up-to-date Docker release on Debian 13.

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

 To run docker commands as a non-root user, you must first add your user to the “docker” group. It is a simple task. To do that, type in the following:

sudo usermod -aG docker ${USER}

In the above command, “${USER}” is a system environment variable that contains your username. Then, run the following command to activate the changes to the group:

newgrp docker

Remember that this is a temporary solution. It will work only for your current terminal session. In other words, if you close the terminal, you will either have to execute the newgrp command above again or prefix docker commands with sudo. To make this change system-wide and to last permanently, reboot your Debian system.