Stop and remove a Docker Compose stack
Medium risk
What do risk levels mean?
- Read-only
- Inspects state without changing anything.
- Low risk
- Reversible with a routine follow-up command.
- Medium risk
- Changes state; undo path documented.
- Destructive
- Deletes or overwrites; confirmation required.
Stops all services of the compose stack in the current directory and removes their containers and networks. Named volumes and images are preserved, so data survives and the stack can be started again.
dockercomposedownservices
Commands
See which services are running and would be stopped
docker compose psStop the services and remove their containers and networks
docker compose downVerification
docker compose psNo services are listed as running.
Undo
Recreate and start the stack again; named volumes reattach with their data intact
docker compose up --detachPitfalls
- Data written inside containers outside named volumes is lost when down removes them; the undo restores services, not that state.
- Adding --volumes to down also deletes named volumes — that variant is destructive and permanently erases the stack's data.
- Run from the same directory (same project name) as the up command, or down will not find the stack.