Back to feed
Dev.to
Dev.to
7/4/2026
How to free up disk space used by Docker

How to free up disk space used by Docker

Short summary

Docker accumulates unused images, stopped containers, dangling volumes, and build cache that can consume significant disk space over time. Run `docker system df` to measure Docker's usage, then use `docker system prune -f` to remove stopped containers and dangling images; add the `--volumes` flag to delete unused volumes, but be aware this permanently deletes any data stored in anonymous volumes. Filter by age with `--filter "until=24h"` to remove only resources older than 24 hours while preserving recent resources.

  • Run `docker system df` to measure Docker's disk usage
  • Use `docker system prune -f` to remove stopped containers and dangling images
  • Add `--volumes` flag to delete unused volumes, but this permanently deletes anonymous volume data
  • Use `--filter "until=24h"` to remove only resources older than 24 hours

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more