The Docker engine is native to Linux and can be used with different servers. We will explain how you can set up Docker on Debian 11 and tell you which types of server are suitable for which uses.

System re­quire­ments for in­stalling Docker on Debian 11

When compared to virtual machines (Vms), Docker con­tain­ers are light­weight and don’t require much in terms of hardware. However, for more complex uses, there will be a need for more storage space as well as ad­di­tion­al resources. To install Docker on Debian 11, you must have the following minimum system re­quire­ments:

  • Processor (CPU): x86-64 ar­chi­tec­ture, min. 2 GHz (single-core)
  • Memory (RAM): min. 2 GB (if using Docker with GUI you need at least 4 GB RAM)
  • Operating system: Debian 11 (Bullseye), user with root rights
  • Kernel: 4.19 or higher, cgroup support, name­spaces, overlay file system and seccomp filter
  • Hard drive space: min. 20 GB
  • Internet con­nec­tion: to download Docker images and packages

Docker hosting: Dedicated vs. Cloud vs. VPS

You can rent different types of servers to use Docker on Debian 11. The provider fees depend on the hardware being used, the type of ar­chi­tec­ture and what kind of per­for­mance you need. Es­sen­tial­ly, you can choose between three server types:

  • Dedicated Server
  • Cloud Server
  • vServer/VPS

A dedicated server is ex­clu­sive­ly used by you, which means it has some great ad­van­tages. Dedicated hardware is able to access more resources than a VPS or a cloud server. Whilst you will pay more, you will benefit from increased per­for­mance by having ad­di­tion­al storage space, RAM and processor cores. Since you have complete control over your Debian server, you will be able to better protect the container en­vi­ron­ment from threats. On top of that, you will be able to set up user-defined tools and con­fig­u­ra­tions.

Tip

A dedicated server from IONOS offers you a large amount of flex­i­bil­i­ty and per­for­mance for your en­ter­prise solutions and is billed by the minute.

You can access cloud servers via networks. They are extremely scalable and are very seldom affected by outages. On top of this, you only pay for the time that you actually use the cloud server.

Tip

With a cloud server from IONOS you can run the Docker engine in a virtual in­fra­struc­ture for little money.

Compared to dedicated hardware a virtual server splits the per­for­mance on a physical server system. A VPS is above all suitable for small or medium-sized con­tain­ers.

Tip

With a VPS from IONOS you can benefit from Docker’s ad­van­tages for a fixed monthly price.

Usage examples for Docker on Debian 11 and com­pat­i­ble IONOS servers

To find the right server, you often need to spend lots of time re­search­ing your options. Even if you are already aware of the different server types that IONOS offers, it is sometimes difficult to find the right offer. To make it easier for you we have sum­ma­rized three typical usage pos­si­bil­i­ties and explain which IONOS server is best suited to them.

Use case Server rec­om­men­da­tion Al­ter­na­tive server rec­om­men­da­tion
Small websites or databases, de­vel­op­ment and testing of simple ap­pli­ca­tions. VPS M Cloud Server S
Con­tin­u­ous in­te­gra­tion and con­tin­u­ous de­ploy­ment (CI/CD), large websites, mi­croser­vice ar­chi­tec­ture Cloud Server M VPS L
En­ter­prise solutions, high-traffic websites, backup solutions for large amounts of data AR6-32 SSD Cloud Server XL

Step by step guide: How to install and use Docker on Debian 11

As soon as you’ve chosen your server solution you can begin with the in­stal­la­tion. Below we will explain how to set up Docker on Debian 11.

To make sure that you are using the latest version of Docker, you should get the in­stal­la­tion package from the Docker repos­i­to­ry. Open the terminal in your Debian system and execute the commands listed below.

Step 1: Update the package list

First update the package index of the repos­i­to­ry that is already installed:

$ sudo apt update
bash

Step 2: Install the necessary packages

In the next step you can install ad­di­tion­al package de­pen­den­cies for the Docker in­stal­la­tion:

$ sudo apt install apt-transport-https ca-certificates gnupg2 software-properties-common
bash

Step 3: Add the GPG key for the Docker repos­i­to­ry

Use the command “curl” to download the GPG key from the official Docker repos­i­to­ry. This ensures that the Docket package is coming from a trusted source.

$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
bash

Step 4: Add the Docker repos­i­to­ry

You can now start the Docker repos­i­to­ry in APT sources which contains a list of all repos­i­to­ries.

$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
bash

Step 5: Update package list

Since you’ve added a new repos­i­to­ry, you will now need to update the package index again so that the in­for­ma­tion in all the repos­i­to­ries is up to date.

$ sudo apt update
bash

Step 6: Check cache policy

Open the cache policy to ensure that the available in­stal­la­tion packages have been down­loaded from the official Docker repos­i­to­ry and not from Docker.

$ apt-cache policy docker-ce
bash

Step 7: Install Docker

You can now install Docker with the following command:

$ sudo apt install docker-ce
bash

Step 8: Test the Docker status

To check that Docker is actually working, you can view the status by entering the following:

$ sudo systemctl status docker
bash

Step 9: Use Docker command

With the command “docker” you can execute commands in Docker. In addition to this primary command, you can enter options, sub­op­tions and commands.

$ docker [option] [command] [arguments]
bash

Step 10: Show the list of sub­com­mands

You can view the list of sub­com­mands by executing the “docker” command in the terminal.

$ docker
bash

Here you can see a selection of the sub­com­mands supported by the “docker” command:

Image: Terminal: List of subcommands
Terminal: List of sub­com­mands.

The con­tain­ers are created by a docker image which is available on the Docker hub. By using the sub­com­mand “pull” you can download the image. There is a container included on the base of the image. To execute the command in a container, you need to use the command “docker run” and enter the cor­re­spond­ing image in the command row.

Tip

Use our guides to find out how you can install Docker on Ubuntu 22.04 and Docker on Ubuntu 20.04.

Options: Run Docker without root rights

For security reasons, it is sometimes a good idea to run Docker without root rights when it has been installed. To do this you can set up a group in your system called Docker and add users. This is the command you will need:

sudo groupadd docker
sudo usermod -aG docker $USER
bash

Note that “$USER” is just a place holder that needs to be replaced with the cor­re­spond­ing username.

Go to Main Menu