# Docker Compose
Docker Compose is a tool for defining and running multi-container applications using a declarative YAML file. Instead of running multiple `docker run` commands with long argument lists, you describe your entire stack—services, networks, volumes, environment variables—in a single `compose.yaml` file and bring it up with `docker compose up`.
A typical compose file defines services (containers), their images, port mappings, volume mounts, dependencies, and restart policies. Compose handles the orchestration: creating networks so containers can communicate by service name, starting services in dependency order, and managing the lifecycle as a unit. This makes complex setups reproducible and version-controllable.
For [[Self-hosting]], Compose is essential. Most self-hosted applications provide ready-made compose files—you configure a few environment variables and run one command. It's the sweet spot between manual container management and full orchestration platforms like Kubernetes: powerful enough for home servers and small deployments, simple enough to understand completely.
## Related
- [[Docker]]
- [[Self-hosting]]
## References
- https://docs.docker.com/compose/