- Docker From Debian
- Docker Build From Debian
- Remove Docker From Debian
- Docker Debian Systemd
- Docker Debian From Scratch
Tutorial
Introduction
Docker is a great tool for automating the deployment of Linux applications inside software containers, but to take full advantage of its potential each component of an application should run in its own individual container. For complex applications with a lot of components, orchestrating all the containers to start up, communicate, and shut down together can quickly become unwieldy.
- Debian is a Linux distribution that's composed entirely of free and open-source software. Container Linux ARM 64 386 riscv64 ARM PowerPC 64 LE mips64le x86-64 IBM Z Base Images Operating Systems Official Image. Copy and paste to pull this image. View Available Tags.
- To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. The Docker daemon pulled the 'hello-world' image from the Docker Hub. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.

The Docker community came up with a popular solution called Fig, which allowed you to use a single YAML file to orchestrate all of your Docker containers and configurations. This became so popular that the Docker team decided to make Docker Compose based on the Fig source, which is now deprecated. Docker Compose lets users orchestrate the processes of Docker containers, including starting up, shutting down, and setting up intra-container linking and volumes.
In this tutorial, you’ll install the latest version of Docker Compose to help you manage multi-container applications on a Debian 10 server.
The debian argument means that the helper container uses the Debian image from Docker Hub. Because the NGINX image also uses Debian (and all of our examples so far use the NGINX image), it is most efficient to use Debian for the helper container, rather than having Docker load another operating system. Run container virtual machine by installing Docker CE on Debian 10 or 11 Bullseye Linux using the guide given here in this article Debian 11 is the latest long-term supported release from the developers of this Linux. The Docker container registry stores Docker images, which are for example used in the Salsa CI toolset. This migration would have moved all data off to Google Cloud Storage (GCS) and would have lowered the used file system space on Debian systems significantly. The Docker container registry is part of the Docker distribution toolset.
Prerequisites
To follow this article, you will need:
- A Debian 10 server and a non-root user with sudo privileges. This initial server setup with Debian 10 tutorial explains how to set this up.
- Docker installed with the instructions from Step 1 and Step 2 of How To Install and Use Docker on Debian 10
Note: Even though the Prerequisites give instructions for installing Docker on Debian 10, the docker
commands in this article should work on other operating systems as long as Docker is installed.
Step 1 — Installing Docker Compose
Although you can install Docker Compose from the official Debian repositories, it is several minor versions behind the latest release, so in this tutorial you’ll install it from Docker’s GitHub repository. The command that follows is slightly different than the one you’ll find on the Releases page. By using the -o
flag to specify the output file first rather than redirecting the output, this syntax avoids running into a “permission denied” error caused when using sudo
.
Docker From Debian

Check the current release and, if necessary, update it in the command that follows:
Next we’ll set the permissions:
Then we’ll verify that the installation was successful by checking the version:
This will print out the version we installed:
Now that we have Docker Compose installed, we’re ready to run a “Hello World” example.
Step 2 — Running a Container with Docker Compose
The public Docker registry, Docker Hub, includes a Hello World image for demonstration and testing. It illustrates the minimal configuration required to run a container using Docker Compose: a YAML file that calls a single image. We’ll create this minimal configuration to run our hello-world
container.
First, create a directory for the YAML file and switch to it:
Then create the YAML file:
Put the following contents into the file, save the file, and exit the text editor:
The first line in the YAML file is used as part of the container name. The second line specifies which image to use to create the container. When we run the docker-compose up
command, it will look for a local image by the name we specified, hello-world
. With this in place, we’ll save and exit the file.

You can look manually at images on our system with the docker images
command:
When there are no local images at all, only the column headings display:
Now, while still in the ~/hello-world
directory, execute the following command:
The first time you run the command, if there’s no local image named hello-world
, Docker Compose will pull it from the Docker Hub public repository:
After pulling the image, docker-compose
creates a container, attaches, and runs the hello program, which in turn confirms that the installation appears to be working:
Docker Build From Debian
Then it prints an explanation of what it did:
Docker containers only run as long as the command is active, so once hello
finished running, the container stopped. Consequently, when we look at active processes, the column headers will appear, but the hello-world
container won’t be listed because it’s not running:
You can see the container information, which you’ll need in the next step, by using the -a
flag. This shows all containers, not just active ones:
This displays the information you’ll need to remove the container when you’re done with it.
Step 3 — Removing the Image (Optional)
To avoid using unnecessary disk space, we’ll remove the local image. To do so, we’ll need to delete all the containers that reference the image using the docker rm
command, followed by either the CONTAINER ID
or the NAME
. In the following example, we’re using the CONTAINER ID
from the docker ps -a
command we just ran. Be sure to substitute the ID of your container:
Remove Docker From Debian
Once all containers that reference the image have been removed, we can remove the image:
Conclusion
Docker Debian Systemd
You’ve installed Docker Compose on Debian 10, tested your installation by running a Hello World example, and removed the test image and container.
Docker Debian From Scratch
While the Hello World example confirmed your installation, this basic configuration does not show one of the main benefits of Docker Compose — being able to bring a group of Docker containers up and down all at the same time. To see how to use Docker Compose in more detail, take a look at How To Install WordPress With Docker Compose.