Skip to main content

Docker Compose

Jürgen's Home Server•Version 1.0.0•

My preferred container system is docker. Docker allows to run multiple services in their own containers which makes maintenance much easier. The docker compose framework allows to create compose projects via simple configuration files.

To install the docker framework including the compose plugin you just have to install the docker-compose-v2 package with following command:

Install Docker Compose

sudo apt install docker-compose-v2

After the installation the docker and the docker compose commands are available. To be able to execute docker commands without the sudo command you have to add yourself to the docker group. This can be done with the following command:

Allow User to Execute Docker Commands

sudo usermod -a -G docker <your_username>

Replace <your_username> with your username.

You can test if docker can be called without sudo by starting the docker hello world application:

Run Docker Hello World

docker run hello-world

If all went well, the hello-world image will be downloaded and you will see a hello world message from docker.