← All notes

docker volume prune: remove unused local volumes

Answer: docker volume prune removes all unused local volumes. By default, it only removes anonymous volumes. Unused volumes are those not referenced by any containers.

Anonymous volumes by default

The command will remove all unused local volumes.

By default, it only removes anonymous volumes.

Unused local volumes are those which are not referenced by any containers.

An example warning says this will remove anonymous local volumes not used by at least one container.

--all and other CLI flags

The --all flag, also written -a, will remove all unused volumes, not just anonymous ones.

The --filter option provides filter values, for example a label match.

The --force flag, also written -f, does not prompt for confirmation.

The CLI description also says to remove all unused local volumes.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker volume prune; Docker CLI, docker volume prune CLI reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker Docs, docker volume prune; Docker CLI, docker volume prune CLI reference. Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Apache-2.0 (https://raw.githubusercontent.com/docker/cli/master/LICENSE). Copyright Docker, Inc.

Cite this

Permanent ID: iil:note:dchnvw21

iinventedlight. 2026. "docker volume prune: remove unused local volumes." iinventedlight Library, iil:note:dchnvw21, version of 2026-11-23. https://iinventedlight.com/library/notes/docker-volume-prune/. License: CC-BY-4.0.

@misc{iil_note_dchnvw21,
  author = {{iinventedlight}},
  title = {{docker volume prune: remove unused local volumes}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-23},
  url = {https://iinventedlight.com/library/notes/docker-volume-prune/},
  note = {Permanent ID iil:note:dchnvw21. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-volume-prune.md.