Skip to main content
DevOps & Docker · Developer Error Resolution Lab

Fix 'docker-compose: command not found' — Migrate to Docker Compose V2 (docker compose)

Compose V1 (docker-compose, Python) is end-of-life. Use the V2 plugin with 'docker compose' or install the compose plugin on Linux servers and CI.

Triggered Error Message:

bash: docker-compose: command not found

Customize Solution for Your Environment
# Debian / Ubuntu: install the V2 plugin
sudo apt-get update && sudo apt-get install -y docker-compose-plugin
docker compose version

# Run your stack
docker compose -f docker-compose.yml up -d

# Keep old scripts working with an alias
echo 'alias docker-compose="docker compose"' >> ~/.bashrc

Root Cause & Mechanism Analysis

Why does this error occur?

Docker Compose V1 was a standalone Python binary named `docker-compose`. It reached end-of-life in 2023 and is no longer shipped. Compose V2 is a Docker CLI plugin invoked as `docker compose` (with a space).

Frequently Asked Questions

Do I need to change my docker-compose.yml?
No. V2 reads the same files. You can also delete the obsolete top-level `version:` key, which V2 ignores and warns about.
DEVSECOPS & CI/CD PARTNER2 Slots Open

Need Zero-Knowledge .env Secret Sync Across Your Engineering Team?

Explore Castov Env Vault for client-side AES-256-GCM encrypted environment sharing, or sponsor this engineering hub.

Browse All 69 Guides