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, namespaces, 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­form­ance you need. Es­sen­tially, you can choose between three server types:

  • Dedicated Server
  • Cloud Server
  • vServer/VPS

A dedicated server is ex­clus­ively used by you, which means it has some great ad­vant­ages. 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­form­ance 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­vir­on­ment from threats. On top of that, you will be able to set up user-defined tools and con­fig­ur­a­tions.

Tip

A dedicated server from IONOS offers you a large amount of flex­ib­il­ity and per­form­ance 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­form­ance 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­vant­ages for a fixed monthly price.

Usage examples for Docker on Debian 11 and com­pat­ible 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­mar­ised three typical usage pos­sib­il­it­ies and explain which IONOS server is best suited to them.

Use case Server re­com­mend­a­tion Al­tern­at­ive server re­com­mend­a­tion
Small websites or databases, de­vel­op­ment and testing of simple ap­plic­a­tions. VPS M Cloud Server S
Con­tinu­ous in­teg­ra­tion and con­tinu­ous de­ploy­ment (CI/CD), large websites, mi­croservice 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­stall­a­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­stall­a­tion package from the Docker re­pos­it­ory. 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 re­pos­it­ory 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­pend­en­cies for the Docker in­stall­a­tion:

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

Step 3: Add the GPG key for the Docker re­pos­it­ory

Use the command ‘curl’ to download the GPG key from the official Docker re­pos­it­ory. 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 re­pos­it­ory

You can now start the Docker re­pos­it­ory in APT sources which contains a list of all re­pos­it­or­ies.

$ 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 re­pos­it­ory, you will now need to update the package index again so that the in­form­a­tion in all the re­pos­it­or­ies is up to date.

$ sudo apt update
bash

Step 6: Check cache policy

Open the cache policy to ensure that the available in­stall­a­tion packages have been down­loaded from the official Docker re­pos­it­ory 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­res­pond­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­res­pond­ing username.

Go to Main Menu