↑ ↓ select, Enter open, Esc close

Remove all unused Docker data including volumes

root@server
docker system prune -a --volumes

The most thorough cleanup option: besides stopped containers and networks, -a removes all images without a running container and --volumes removes unused volumes. A volume counts as unused as soon as no container references it, which includes a Compose stack that was just stopped with down.

Note: Databases and uploads in volumes are irrevocably deleted afterwards. Check with docker volume ls first and back up important volumes.

Open question before approval: Verhalten von --volumes je nach Docker-Version prüfen: seit Docker 23 werden standardmäßig nur anonyme Volumes entfernt, ältere Versionen (Debian 12 docker.io 20.10) entfernen alle ungenutzten Volumes.

Also searched as

  • docker free up disk space completely
  • docker system prune all volumes
  • delete everything docker

Related one-liners

All in Docker

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.