# docker volume prune: Remove Unused Volumes

> How docker volume prune works: bulk-removing unused volumes, the -a flag, and reclaiming volume disk on CI runners.

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

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.

## FAQ

### docker volume prune: Remove Unused Volumes?

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

---

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
