Docker Compose is a CLI tool and Docker plugin for defining and running multi-container applications. You describe services, networks, and volumes in a compose.yaml file (following the Compose Specification), then bring the whole stack up or down with a single command. It's built for developers and ops engineers who run more than one container together, whether that's an app plus a database, a set of microservices, or a local dev environment that mirrors production.
Instead of running several docker run commands with long option lists, you write one file that captures build instructions, ports, volumes, and dependencies between services. Compose reads that file and handles creating the containers, networks, and volumes needed to run them together.
docker compose up builds, creates, and starts everything defined in the file; docker compose down tears it down.Dockerfile to build locally or an existing image from a registry.docker compose), replacing the older Python docker-compose binary.Compose fits local development environments where you need a database, cache, and app server running together without manually wiring up networking each time. It's also useful for CI pipelines that spin up dependent services for integration tests, and for small deployments where a single host runs a fixed set of containers.
It's a good fit if you want a reproducible, version-controlled definition of your app's runtime environment that any teammate can start with one command.
It's not the right tool for multi-host orchestration or production-grade scheduling with autoscaling, rolling updates across a cluster, or self-healing at scale. For that you want Kubernetes or a similar orchestrator. It's also not a substitute for Docker Swarm-specific features; the README notes Swarm relies on a legacy compose format and, since Swarm is no longer maintained by Docker Inc. following its acquisition by Mirantis, some newer Compose syntax isn't available to Swarm users.
On Windows and macOS, Docker Compose ships with Docker Desktop, so no separate install is needed.
On Linux, download the binary for your platform from the project's release page, then install it as a CLI plugin:
# Rename the downloaded binary and place it in your user's plugin directory
mv docker-compose-linux-x86_64 ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
To install system-wide instead, copy the renamed, executable binary into one of:
/usr/local/lib/docker/cli-plugins
/usr/local/libexec/docker/cli-plugins
/usr/lib/docker/cli-plugins
/usr/libexec/docker/cli-plugins
Once installed, define your app in a compose.yaml file, for example:
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
redis:
image: redis
Then start it with:
docker compose up
Compose builds the web service from the local Dockerfile, pulls the redis image, and starts both containers connected on a shared network.