The first time I adopted Docker Compose, the difference between docker-compose and docker compose broke roughly half my scripts. Every doc spells it differently, so it is hard to tell which one is current. This guide covers V2 specifically, from install through day-to-day operation.
Docker Compose V2 ships as a Docker CLI plugin and runs as docker compose . The older docker-compose (V1, hyphenated) reached end of support in July 2023 and is no longer recommended. On Ubuntu you install it via apt; on Windows it comes bundled with Docker Desktop.
The difference between Compose V1 and V2
Installing on Ubuntu
Installing on Windows with Docker Desktop
Writing a compose.yaml
Running it, plus a command reference
Common errors and how to fix them
FAQ
Related reading
The difference between Compose V1 and V2
V1 was a standalone binary written in Python, using the hyphenated docker-compose command.…