↑ ↓ select, Enter open, Esc close

Clean up unused Docker data

Caution: This command changes the system. Understand what it does before you run it.

root@server
docker system prune

Cleans up everything that is currently unused in one step: stopped containers, networks without containers, dangling images and the build cache. Volumes, and with them databases and uploads, remain untouched. Docker lists what will be removed beforehand and asks for confirmation.

Note: Stopped containers are deleted, along with everything that existed only in their writable layer. If you have only paused a container temporarily, start it first. Docker commands require root or the docker group.

Also searched as

  • docker free up disk space
  • docker system prune
  • clean up docker safely

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.