How to Install Docker Compose on Ubuntu 20.04
Table of contents
Actualizado: 2026-05-03
Docker Compose[1] is the official tool for defining and running multi-container Docker applications. Instead of starting each container separately, Docker Compose reads a docker-compose.yml file that describes all the application’s services, networks, and volumes, and starts them all with a single command. This article explains how to install it on Ubuntu 20.04 from the official repository.
Key takeaways
- Docker Compose complements Docker: it manages applications made up of several coordinated containers.
- Installation is done by downloading the binary directly from Docker’s GitHub repository.
- Before installing, check the releases page[2] to install the most recent version.
- Docker Compose v2 is integrated as a Docker CLI plugin (
docker compose) in modern installations; the standalone version (docker-compose) remains valid for Ubuntu 20.04.
Prerequisites
To complete this tutorial you need:
- A server running Ubuntu 20.04[3].
- Docker installed following the steps in How to Install Docker on Ubuntu 20.04.
Install Docker Compose
We use the official Docker Compose GitHub repository[4] to install the latest available version.
Important: before running the commands, check the Docker Compose releases page[2] and update the VERSION value to the most recent release.
VERSION=1.27.0
sudo curl -L "https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-composeThe first command downloads the binary matching the system architecture ($(uname -s) returns Linux, $(uname -m) returns x86_64 on 64-bit servers). The second grants execute permissions.
Verify the installation
Check that Docker Compose was installed correctly and is available on the system:
docker-compose --versionThe output should show something like docker-compose version 1.27.0, build .... If the command is not found, verify that /usr/local/bin/ is in the system PATH.
Basic usage
With Docker Compose installed, the typical workflow is:
- Create a
docker-compose.ymlfile defining the application’s services. - Run
docker-compose up -dto start all containers in detached (background) mode. - Use
docker-compose psto check service status. - Stop and remove containers with
docker-compose down.
Docker Compose is the starting point for deploying complete stacks, such as Traefik as a reverse proxy with Docker Compose or more complex applications with coordinated databases, caches, and web services. If you’re looking for observability tooling over your containers, see the post on Pixie for Kubernetes observability.
Conclusion
Docker Compose radically simplifies multi-container application management: instead of launching and configuring each service separately, a single YAML file describes the entire architecture. With the binary installed and the right permissions, the environment is ready to define complete stacks in minutes.