Docker Compose Cheatsheet - Command Reference
For developers who need to bring up, stop, and upgrade a whole stack at once — database, cache, backend, frontend — as a single unit. Compose value is not in the commands themselves but in a single docker-compose.yml that pins down the network, dependencies, and config between services so the whole environment can be started and stopped repeatedly. By the end you can bring the stack up with up, find the failing service with logs, clean up fully (and safely) with down -v, and scale out with --scale.
Start & Stop 5
docker compose up -ddocker compose up -d --builddocker compose stopdocker compose downdocker compose restart svcLogs & Status 5
docker compose psdocker compose logs -f svcdocker compose logs --tail=100 svcdocker compose topdocker compose port svc 80Config & Build 5
docker compose configdocker compose builddocker compose pulldocker compose exec svc shdocker compose run --rm svc cmdNetwork & Volume 5
docker compose up -d --scale svc=3docker network lsdocker compose down -vdocker volume lsdocker compose config --volumesFAQ 5
Q: What is the difference between docker compose up and docker compose start?Q: How do I rebuild images?Q: How do I view Compose project logs?Q: How do I start only a specific service?Q: How do I remove all containers and volumes?Tips
- Compose commands look for docker-compose.yml in the current directory by default; use -f for other files, -p for project name.
- down does not remove volumes by default — add -v to remove them; back up production volumes first, named volume data is irrecoverable.
- Services scaled with --scale must not use fixed host ports, or multiple instances will conflict.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us