How to Install Docker Engine on Debian 13 (Step-by-Step Guide)

In this tutorial, you will learn how to install Docker Engine on Debian 13. We cover the entire installation process, from cleaning up old versions to configuring user permissions, and finally running a test container to confirm your Debian Docker installation is successful.

Before You Start

To download the Docker installation script, you’ll need the curl command. Make sure it’s installed on your computer.

sudo apt update
sudo apt install curl

Install Docker Engine

To install Docker on Debian 13, you need to follow three main steps.

  1. Uninstall Previous Docker Versions
  2. Download the Official Docker Installation Script
  3. Execute the Script to Install Docker Engine

Run the following command to remove any previous Docker versions from your Debian system:

for pkg in docker-ce docker-ce-cli docker-desktop docker-model-plugin containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get purge -y $pkg; done

Next, download the official Docker installation script:

curl -fsSL https://get.docker.com -o get-docker.sh

After downloading the script, execute it to install Docker Engine:

sudo sh get-docker.sh

Once the script finishes, Docker Engine will be installed on your Debian 13 system.

install docker debian 13

You may see a message suggesting that you configure Docker to run in rootless mode.

That step is optional — it’s used to run Docker without root privileges for extra security. You can do it later if you prefer, but it’s not necessary right now.

Verify the Docker Installation on Debian

To confirm the installation was successful and the Docker daemon is running, we will check the installed version.

docker version

This command will output the version details of the Docker Engine installed on your Debian 13 system.

check docker version

Configure User Permissions (Run Docker Without sudo)

By default, only the root user can run docker commands. If you try to run a docker command as a standard user, you will get a "permission denied" error.

To fix this and allow your standard user to run Docker without sudo, you must add your user to the special docker user group.

Add Your User to the docker Group

Use the gpasswd command (as the root user) to add your user (replace your_username with your actual username) to the docker group:

gpasswd -a your_username docker

For the group changes to take effect, you must log out and log back in. You can use the groups command to check your group membership:

groups

You should see docker in the list of groups the user belongs to. If it doesn’t appear immediately, you may need to restart your computer.

Run Docker Without sudo

Once the user is in the Docker group, you’ll be able to run docker commands without sudo.

Test Docker Installation with hello-world Container

Finally, to fully confirm your Docker setup on Debian 13 is functional, we will run the official test container.

docker run hello-world

If your installation is successful, you’ll see the message “Hello from Docker!” printed in the terminal.

hello-world Container
hello-world Container on Debian Docker

This confirms that your Docker setup is working correctly.

What’s Next

Now that Docker Engine is installed and configured on your Debian 13 system, the next step is to learn how to run and manage containers.

Check out our Docker Run Command Tutorial to understand how to start containers, run applications, and explore Docker’s core features.

This will help you make the most of your new Docker setup and start using containers effectively.