How to Install Docker Compose on Ubuntu 20.04
Table of contents
- Key takeaways
- Prerequisites
- Install Docker Compose on Ubuntu
- Verify the installation
- Basic usage
- Frequently asked questions
- What's the difference between docker-compose and docker compose?
- Why does this guide install v1 if it's unmaintained?
- Do I need to install Docker Compose if I already have Docker Engine?
- How do I upgrade Docker Compose to a newer version?
- What if docker-compose --version doesn't work after installing?
- Conclusion
- Sources
Updated: 2026-07-07
Learn to install Docker Compose on Ubuntu 20.04 by downloading the binary from GitHub. Step-by-step guide for multi-container orchestration.
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]. Note that standard support for this release ended in May 2025; if you’re still on it, check the Ubuntu release cycle[4] and consider Ubuntu Pro (ESM) or planning a move to a newer LTS.
-
Docker installed following the steps in How to Install Docker on Ubuntu 20.04.
Install Docker Compose on Ubuntu
We use the official Docker Compose GitHub repository[5] 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-compose
The 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.
Docker logo, the platform that includes Docker Compose for container orchestration
Verify the installation
Check that Docker Compose was installed correctly and is available on the system:
docker-compose --version
The 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.
Frequently asked questions
What’s the difference between docker-compose and docker compose?
docker-compose (with a hyphen) is the standalone Python binary this guide installs: v1, which Docker’s own documentation[6] already marks as unmaintained. docker compose (no hyphen, as a subcommand) is v2, rewritten in Go and bundled into the Docker CLI as a plugin. Both read the same docker-compose.yml and accept nearly the same flags, so migrating usually just means swapping the space for the hyphen in your scripts.
Why does this guide install v1 if it’s unmaintained?
Because plenty of Ubuntu 20.04 servers still have v1 deployed, or automation that depends on the standalone binary, and understanding that path helps when you’re debugging an older install. For a fresh server, install the v2 plugin directly with sudo apt install docker-compose-plugin from Docker’s own repository (not the docker-compose package in Ubuntu’s repos, which tends to lag several versions behind).
Do I need to install Docker Compose if I already have Docker Engine?
Yes. Docker Engine and Docker Compose are separate packages: Engine runs individual containers, Compose adds the multi-container orchestration layer on top of a YAML file. The official docker-ce package doesn’t include it by default; you install it separately, either the standalone binary from this tutorial or the v2 plugin.
How do I upgrade Docker Compose to a newer version?
If you used the standalone method from this tutorial, repeat the same two commands with an updated VERSION value: the curl overwrites the previous binary. If you’re on the v2 plugin via apt, sudo apt update && sudo apt upgrade docker-compose-plugin is enough.
What if docker-compose --version doesn’t work after installing?
First check that /usr/local/bin is in your PATH (echo $PATH). If the binary exists but isn’t executable, check that the chmod +x from the previous step completed without permission errors (you may need sudo or membership in a group with write access to that directory).
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, though for a new deployment the sensible starting point today is the v2 plugin rather than the standalone binary in this guide.