Skip to content
Latchkey

docker volume prune: Remove Unused Volumes

Remove unused volumes to reclaim disk.

docker volume prune deletes volumes not used by any container. This page covers the scope of "unused" and the data-loss caution for CI.

What it does

docker volume prune removes anonymous volumes not referenced by a container (default), and with -a all unused volumes including named ones. This reclaims disk from orphaned volumes.

Common usage

Terminal
docker volume prune -f
docker volume prune -af                 # include named unused volumes

Common errors in CI

Without -f it prompts and stalls CI - pass -f. Pruning is irreversible: -af removes named volumes too, so on a persistent runner this can wipe a cache or database volume you meant to keep. Scope cleanup, or use labels and --filter "label!=keep" to protect specific volumes.

Related guides

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