Skip to content
Latchkey

docker compose down: Tear Down a Compose Stack

Stop and remove the whole stack - containers, networks, and optionally volumes.

docker compose down stops and removes the containers, networks, and (optionally) volumes a stack created. This page covers the flags for a clean CI teardown.

What it does

docker compose down removes the containers and default network created by up. By default it keeps named volumes; -v (--volumes) also removes them, and --rmi removes images. It is the inverse of docker compose up.

Common usage

Terminal
docker compose down
docker compose down -v                   # also remove volumes
docker compose down --rmi local --remove-orphans

Common errors in CI

If down "does nothing", you are likely in a different directory or using a different project name than up - compose scopes by project (directory name or -p). Use --remove-orphans to clear containers from a removed service definition. In CI, always run docker compose down -v in an always()/cleanup step so a leftover stack does not hold ports or volumes for the next job.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →