Skip to main content

Docker Compose

Docker Compose simplifies the management of multi-container applications with Docker. This leaves more time to focus on the applications and not so much on your infrastructure.

Installation

To use Docker Compose, Docker and Docker Compose must first be installed. In principle, any server can be used, regardless of whether it is a server in the home network or a rented one in a data center.

Docker Engine

sudo apt install ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Docker Compose

sudo mkdir -p /usr/local/lib/docker/cli-plugins/
sudo curl -SL https://github.com/docker/compose/releases/download/v2.3.4/docker-compose-linux-x86_64 -o /usr/local/lib/docker/cli-plugins/docker-compose
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose

If there is a new release of Docker Compose, you have to change the respective line in the command.

info

Depending on whether you install Docker Compose version 1 or 2, the syntax changes. With version 1 it is still docker-compose, with version 2 it is finally docker compose. You always have to keep this in mind.

warning

If you have a device with an ARM CPU (e.g. Raspberry Pi), only the ARM compatible images will work. All Docker images that are not intended for ARM devices will not work.

On Docker Hub, you can filter operating systems and architectures to identify applications that are fully supported.