Docker Compose Generator
Build a docker-compose.yml in your browser: services, ports, volumes, environment variables, depends_on, and restart policies. Copy or download the YAML — nothing is sent to a server.
0 services
Tip: After generating YAML, validate it with
docker compose config or use the Docker Compose Validator.
Frequently Asked Questions
Should I use docker-compose or docker compose?
Use docker compose (space) — that is Docker Compose v2, built into the Docker CLI. The old docker-compose (hyphen) was v1 and is end-of-life.
How do I keep secrets out of docker-compose.yml?
Use environment variables and a .env file (not committed to Git), or use your deployment platform’s secret store. For Swarm/Kubernetes, prefer secrets/configs.
What are good default restart policies?
For most long-running services on a single server, unless-stopped is a good default. Use on-failure for batch jobs, and avoid restarting crash-looping containers without investigating logs.