Install Docker Compose on Ubuntu, Debian and Mac (2026)
Docker Compose is now a Docker CLI plugin. You install the package docker-compose-plugin and run it as docker compose, with a space. On Ubuntu and Debian, add Docker's apt repository, then run sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin. Check it with docker compose version. The old docker-compose command (Compose v1, with a hyphen) stopped getting updates in July 2023.
The current release is Compose v5 (v5.6.0 in October 2026). Every method below installs it.
Is Docker Compose already installed?
docker compose version
# Docker Compose version v5.6.0
If you see a version, you are done. If you see docker: 'compose' is not a docker command, Docker is installed but the Compose plugin is not. Jump to Add Compose to an existing Docker install.
Install Docker Compose on Ubuntu (22.04, 24.04, 26.04)
This is the official method. It installs Docker Engine and the Compose plugin from Docker's own apt repository, so apt upgrade keeps both up to date.
1. Remove conflicting packages
Ubuntu ships unofficial packages (docker.io, docker-compose, docker-compose-v2) that conflict with Docker's packages. Remove them first. apt may report that none are installed. That is fine.
sudo apt remove $(dpkg --get-selections docker.io docker-compose docker-compose-v2 docker-doc docker-buildx podman-docker containerd runc | cut -f1)
Your images, containers and volumes in /var/lib/docker/ are kept.
2. Add Docker's apt repository
# Add Docker's official GPG key:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
Docker's docs now use a .sources file (deb822 format). Older guides write a one-line docker.list file instead. Both work, but do not keep both: apt warns about duplicate sources.
3. Install Docker Engine and the Compose plugin
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
4. Check that it works
docker compose version
sudo docker run hello-world
If hello-world prints its welcome message, Docker and Compose are ready.
Install Docker Compose on Debian (12, 13)
The steps are the same as Ubuntu. Only the repository URL and the codename variable change:
sudo apt update
sudo apt install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
sudo tee /etc/apt/sources.list.d/docker.sources <<EOF
Types: deb
URIs: https://download.docker.com/linux/debian
Suites: $(. /etc/os-release && echo "$VERSION_CODENAME")
Components: stable
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/docker.asc
EOF
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Docker supports Debian 13 (Trixie) and Debian 12 (Bookworm).
Add Compose to an existing Docker install
If Docker Engine is already installed from Docker's repository, install only the plugin:
# Ubuntu / Debian
sudo apt update
sudo apt install docker-compose-plugin
# Fedora / RHEL / CentOS
sudo dnf install docker-compose-plugin
If apt answers Unable to locate package docker-compose-plugin, Docker's repository is missing. Add it with step 2 above, or see Fix "unable to locate package docker-compose-plugin".
Install Docker Compose on any Linux (manual binary)
Use this when you cannot add Docker's repository: an unsupported distro, a locked-down server, or a fixed Compose version. The plugin is one static binary.
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-$(uname -m)" \
-o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
$(uname -m)picks the right build:x86_64on Intel/AMD,aarch64on ARM (Raspberry Pi 64-bit, Graviton, Ampere).- This installs Compose for your user only. For all users, put the binary in
/usr/local/lib/docker/cli-plugins/instead and run the commands withsudo. - For a fixed version, replace
latest/downloadwithdownload/v5.6.0. - A manual install does not update itself. Repeat the
curlcommand to upgrade.
Install Docker Compose on Mac
Docker Desktop (easiest)
- Download Docker Desktop for Mac. Pick Apple silicon or Intel.
- Drag Docker to Applications and open it.
- Run
docker compose versionin a terminal.
Docker Desktop includes Docker Engine, the CLI and Compose. Note that Docker Desktop needs a paid subscription for companies with more than 250 employees or more than $10 million in annual revenue.
Homebrew and Colima (no Docker Desktop)
brew install docker docker-compose colima
colima start
Homebrew installs Compose as a CLI plugin, but Docker does not look in Homebrew's folder by default. Add this to ~/.docker/config.json (create the file if it does not exist), then docker compose version works:
{
"cliPluginsExtraDirs": [
"/opt/homebrew/lib/docker/cli-plugins"
]
}
On an Intel Mac the path is /usr/local/lib/docker/cli-plugins.
Install Docker Compose on Windows
Install Docker Desktop for Windows with the WSL 2 backend. It includes Compose. Inside a WSL 2 distro you can also follow the Ubuntu steps above and skip Docker Desktop.
Run Docker without sudo
By default only root can talk to the Docker daemon. To run docker compose as your user:
sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker # or log out and back in
Members of the docker group have root-level access to the host. Only add users you would give sudo.
docker-compose vs docker compose
docker-compose (v1) | docker compose (v2 and later) | |
|---|---|---|
| Written in | Python | Go |
| Installed as | Separate program | Docker CLI plugin |
| Package | docker-compose (distro) | docker-compose-plugin (Docker repo) |
| Status | No updates since July 2023 | Current release v5 |
Your docker-compose.yml files work with both. Scripts that call docker-compose with a hyphen need a change. Replace the hyphen with a space, or add a small wrapper:
echo 'docker compose "$@"' | sudo tee /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Update Docker Compose
If you installed from Docker's repository, update with apt:
sudo apt update
sudo apt install --only-upgrade docker-compose-plugin
This updates Compose itself. To update the images your services run, see Update Docker Compose images.
Troubleshooting
docker: 'compose' is not a docker command
Docker is installed, the Compose plugin is not. Install docker-compose-plugin (see above). After a manual install, check that the binary is at ~/.docker/cli-plugins/docker-compose and is executable. On a Mac with Homebrew, add cliPluginsExtraDirs as shown above.
docker-compose: command not found
You are using the old v1 command. Run docker compose with a space, or add the wrapper from docker-compose vs docker compose.
E: Unable to locate package docker-compose-plugin
apt cannot see Docker's repository. Run step 2 again and then sudo apt update. Full walkthrough: Fix "unable to locate package docker-compose-plugin".
permission denied while trying to connect to the Docker daemon socket
Your user is not in the docker group, or you added it and did not log in again. See Run Docker without sudo.
Cannot connect to the Docker daemon. Is the docker daemon running?
Start it and enable it on boot:
sudo systemctl enable --now docker
On a Mac, open Docker Desktop or run colima start. To make your containers come back after a reboot as well, see Start Docker containers on boot.
Frequently asked questions
How do I install Docker Compose on Ubuntu?
Add Docker's apt repository (GPG key in /etc/apt/keyrings/docker.asc and a docker.sources file), run sudo apt update, then sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin. Check it with docker compose version. This works on Ubuntu 22.04, 24.04 and 26.04.
How do I check which Docker Compose version is installed?
Run docker compose version. It prints a line such as 'Docker Compose version v5.6.0'. If you get 'compose is not a docker command', the Compose plugin is not installed.
Is Docker Compose included with Docker?
Docker Desktop on Mac and Windows includes Compose. On Linux, Docker Engine and Compose are separate packages: install docker-compose-plugin next to docker-ce. The official install command installs both together.
What is the difference between docker-compose and docker compose?
docker-compose with a hyphen is Compose v1, a separate Python program that stopped getting updates in July 2023. docker compose with a space is the current Go plugin for the Docker CLI. Compose files work with both; only the command changes.
How do I install Docker Compose without root or without apt?
Download the static binary from the docker/compose GitHub releases into ~/.docker/cli-plugins/docker-compose and make it executable. This needs no root and no package manager, but it does not update itself; repeat the download to upgrade.
How do I update Docker Compose?
If you installed it from Docker's repository, run sudo apt update and then sudo apt install --only-upgrade docker-compose-plugin. For a manual install, download the new binary over the old one. Docker Desktop updates Compose with its own updates.
Ready to deploy?
Once Docker Compose runs on your machine, you can run the same stack in the cloud without managing a server.
Hostim.dev supports Docker Compose natively. Paste your docker-compose.yml and we handle SSL, volumes and databases.