Docker Compose
Define and run multi-container Docker applications.
Docker Compose reads a compose.yaml file describing a set of related containers, networks, and volumes, and brings them up together with a single "docker compose up" command. It is the standard way to run a small multi-service application on a development machine, and a popular choice for self-hosted single-server deployments where Kubernetes would be overkill.
The compose file specifies each service's image, build context, environment variables, ports, volumes, dependencies, restart policies, and networking. The same file can be reused across development, staging, and production with environment-specific overrides via "docker compose -f base.yaml -f prod.yaml up".
Docker Compose was originally Fig (a separate startup) before Docker Inc. acquired it in 2014 and rebranded it as Compose. It is now bundled directly with modern Docker Engine. For self-hosters, the typical pattern is one Git repository per host with a docker-compose.yaml plus a Caddy reverse proxy that fronts everything in the compose file with TLS termination.
Install
Bundled with recent Docker Engine versions. Standalone: sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose
Authors
- Docker Inc. and contributors