Skip to content

Install Docker Compose V2

Since Docker Compose V2 is now built directly into the docker CLI as docker compose (note the space), installation is much simpler than before.
Here’s the clean, recommended way to install it:

1️⃣ Install Docker Engine (if not already installed)

sudo apt update

sudo apt install ca-certificates curl gnupg lsb-release -y

sudo mkdir -m 0755 -p /etc/apt/keyrings

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.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 install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y

This installs:
Docker Engine
docker buildx plugin
docker compose plugin (V2)

2️⃣ Test Docker Compose V2

Run:
docker compose version
Expected output (example):
Docker Compose version v2.29.2
You now use:
docker compose up
instead of the old:
docker-compose up

3️⃣ (Optional) Enable Docker to start on boot

sudo systemctl enable docker
sudo systemctl start docker

4️⃣ (Optional) Add your user to the docker group

sudo usermod -aG docker $USER
newgrp docker
✅ That’s it — Docker Compose V2 is already included as a plugin when you install docker-compose-plugin.
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.