# docker compose down: Tear Down a Compose Stack

> How docker compose down works: stopping and removing services, networks, and volumes, the -v flag, and clean CI teardown.

Source: https://latchkey.dev/learn/command-reference/docker-compose-down  
Updated: 2026-06-25

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.

## FAQ

### docker compose down: Tear Down a Compose Stack?

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 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.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
