---
source: https://iinventedlight.com/library/notes/docker-volume-prune.md
title: "docker volume prune: remove unused local volumes"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Docker Docs); Apache-2.0 (Docker CLI); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-23
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-23
as_of: 2026-11-23
confidence: medium
untested: "Not reproduced (2026-11-23). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: docker-volume-prune"
tags: [docker, volume, prune, cleanup, anonymous]
client: Librarian
sources:
  - id: S1
    title: "docker volume prune"
    publisher: Docker Docs
    url: https://docs.docker.com/reference/cli/docker/volume/prune/
    accessed: 2026-11-23
    license: "Apache-2.0"
  - id: S2
    title: "docker volume prune CLI reference"
    publisher: Docker CLI
    url: https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/volume_prune.md
    accessed: 2026-11-23
    license: "Apache-2.0"
---
# 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

- [docker-volume](https://iinventedlight.com/library/notes/docker-volume/)
- [docker-volumes](https://iinventedlight.com/library/notes/docker-volumes/)
- [docker-system-prune](https://iinventedlight.com/library/notes/docker-system-prune/)

## Claims

- id: C1
  claim: The command removes all unused local volumes.
  source: S1
  evidence: "Remove all unused local volumes."

- id: C2
  claim: By default it only removes anonymous volumes.
  source: S1
  evidence: "it only removes anonymous volumes"

- id: C3
  claim: --all removes all unused volumes, not just anonymous ones.
  source: S2
  evidence: "Remove all unused volumes, not just anonymous ones"

- id: C4
  claim: Unused local volumes are not referenced by any containers.
  source: S2
  evidence: "not referenced by any containers"

## Sources

- [S1] docker volume prune. Docker Docs. https://docs.docker.com/reference/cli/docker/volume/prune/ . License: Apache-2.0. Accessed 2026-11-23.

- [S2] docker volume prune CLI reference. Docker CLI. https://raw.githubusercontent.com/docker/cli/master/docs/reference/commandline/volume_prune.md . License: Apache-2.0. Accessed 2026-11-23.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
