Docker Compose — Install Compose V2
Docker Compose V2 comes bundled with Docker Desktop and modern Docker Engine installations. You probably already have it. This page covers installation and verification for all platforms.
Docker Desktop (Mac, Windows, Linux GUI)
If you have Docker Desktop installed, you already have Compose V2. It’s included automatically.
docker compose version
Expected output:
Docker Compose version v2.24.0
Docker Desktop includes:
- Docker Engine
- Docker CLI
- Docker Compose V2 (as a CLI plugin)
- Docker BuildKit
- Docker Scout
Linux (Docker Engine)
On Linux servers without Docker Desktop, Compose V2 is installed as a CLI plugin.
Option 1 — Install with Docker Engine (Recommended)
If you install Docker Engine using the official apt/yum repository, Compose V2 is available as a package:
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install docker-compose-plugin
# CentOS/RHEL/Fedora
sudo yum install docker-compose-plugin
Verify:
docker compose version
Docker Compose version v2.24.0
Option 2 — Manual Installation
Download the binary directly:
# Download latest Compose V2 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-x86_64 \
-o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
Verify:
docker compose version
How the CLI Plugin Works
Compose V2 is a Docker CLI plugin, not a standalone binary:
┌─────────────────────────────────────────┐
│ Docker CLI (docker) │
│ │
│ Built-in commands: │
│ docker run, docker build, docker ps │
│ │
│ Plugin commands: │
│ docker compose ← Compose V2 plugin │
│ docker buildx ← BuildKit plugin │
│ docker scout ← Scout plugin │
│ │
│ Plugin location: │
│ ~/.docker/cli-plugins/ │
│ └── docker-compose (binary) │
└─────────────────────────────────────────┘
When you type docker compose, the Docker CLI:
- Looks in
~/.docker/cli-plugins/for a binary nameddocker-compose - Passes the remaining arguments to that binary
- Returns the output
Removing Compose V1
If you still have the old V1 installed, you can remove it:
# Check if V1 exists
which docker-compose
# Remove V1 (if installed via pip)
pip uninstall docker-compose
# Remove V1 (if installed as binary)
sudo rm /usr/local/bin/docker-compose
Minimum Docker Version
Compose V2 requires Docker Engine 20.10 or later. Check your Docker version:
docker --version
Docker version 24.0.7, build afdd53b
If your Docker version is older than 20.10, upgrade Docker first.
Summary
| Platform | Installation Method |
|---|---|
| Docker Desktop (Mac/Win/Linux) | Already included |
| Linux (apt/yum) | sudo apt-get install docker-compose-plugin |
| Linux (manual) | Download binary to ~/.docker/cli-plugins/ |
| Minimum Docker | Engine 20.10+ |
Quick Reference
| Item | Detail |
|---|---|
| Docker Desktop | Compose V2 included automatically |
| Linux install | sudo apt-get install docker-compose-plugin |
| Plugin location | ~/.docker/cli-plugins/docker-compose |
| Minimum Docker | Engine 20.10 or later |
| Verify install | docker compose version |
| Remove V1 | sudo rm /usr/local/bin/docker-compose |