9.4.2.4 Down Volume Removal
A focused guide to Down Volume Removal, connecting core concepts with practical Docker and container operations.
Down volume removal is the more thorough, explicitly requested teardown behavior activated by the -v flag on docker compose down, removing not just containers and networks but also the application's declared named volumes, permanently discarding whatever data they held.
Explicitly Requesting Volume Removal
The -v flag extends down's default behavior to also remove volumes.
docker compose down -v
Removing volume myapp_pgdata
This volume, and any data it held, is now permanently gone.
Why This Should Be a Deliberate, Conscious Choice
Because this permanently discards data that a plain down would have preserved, this flag should be used only when a genuinely fresh start — including discarding all existing data — is actually intended.
docker compose down -v
docker compose up -d
This sequence results in entirely fresh, empty volumes for the new containers, with no continuity from whatever data existed before.
A Common, Legitimate Use Case for This Flag
Testing an application's behavior from a completely clean state — verifying an initialization script runs correctly on a fresh database, for instance — is a legitimate, common reason to deliberately use this more thorough teardown.
docker compose down -v
docker compose up -d
docker compose logs db
Reviewing the database's logs after this fresh start confirms whether its initialization behavior works correctly when starting from genuinely empty storage.
Confirming Volume Removal Actually Occurred
Checking that the relevant volume no longer exists validates this more thorough teardown completed as intended.
docker volume ls
Why Down Volume Removal Matters
Understanding both that this flag exists and exactly what it does is important both for deliberately achieving a genuinely clean reset when that's the actual goal, and for avoiding its accidental use when only the default, volume-preserving teardown was actually intended.