Fix Docker that runs out of space
We'll check disk usage with docker system df, prune images and volumes with docker system prune and docker volume prune, and free space—or tell you when to escalate.
What you'll need
- Docker installed and running
- sudo or root (for host df if needed)
Step-by-step diagnostic
Quick triage — pick your path
Get started
Choose the option that matches what you see. You can jump straight to that section.
Show full guide
Steps
Goal: Check Docker disk usage, prune unused data, and free space.
- Run
docker system dfto see what is using space. - Good: You see images, containers, volumes, build cache. Proceed to Check Docker disk usage.
- Bad: Docker not running—start the daemon or check the host.
Check Docker disk usage
Goal: Identify what Docker data is reclaimable.
- Run
docker system df. Check the RECLAIMABLE column. Images, stopped containers, and unused volumes are often reclaimable. - Run
df -hon the host to confirm whether the host disk is also full. - Good: You know what to prune. Proceed to Prune images and volumes.
- Bad: Host disk 100%—see fix-linux-runs-out-of-disk for host cleanup.
Prune images and volumes
Goal: Remove unused Docker data to free space.
- Run
docker container pruneto remove stopped containers. - Run
docker image prune -ato remove unused images. - Run
docker system prune -ato remove stopped containers, unused networks, and all unused images. Add-vto include volumes—check that no running containers need them first. - Run
docker volume pruneto remove volumes not used by any container. - Run
docker builder prune -ato clear build cache. - Good: Space freed. You are done.
- Bad: Host still full—see fix-linux-runs-out-of-disk.
When to escalate
Escalate if:
- You cannot identify what is using space.
- Cleanup would remove critical data.
- The host disk is full and you cannot safely free space.
Provide docker system df output and df -h before escalating.
Verification
docker system dfshows reduced usage and reclaimable space is low.df -hon the host shows free space if it was full.- Docker builds and pulls succeed without “no space left” errors.
Escalation ladder
Work from the device outward. Stop when the problem is fixed.
- docker system df Run docker system df to see usage.
- Prune containers and images docker container prune; docker image prune -a.
- docker system prune docker system prune -a; add -v for volumes if safe.
- docker volume prune docker volume prune; check no running containers need volumes.
- Escalate Provide docker system df and df -h; consider host cleanup.
What to capture if you need help
Before calling support or posting for help, have these ready. It speeds everything up.
- docker system df output
- df -h output (host)
- Steps already tried
Does Docker report no space?
Check docker ps, docker images, or build errors. Run df -h on the host.
You can change your answer later.
Run docker system df
See images, containers, volumes, build cache.
You can change your answer later.
Prune containers, images, volumes
docker system prune -a; docker volume prune.
You can change your answer later.
Host disk full?
df -h shows 100% on root or /var.
Done
Reviewed by Blackbox Atlas
Frequently asked questions
- Why does Docker run out of space?
- Images, stopped containers, volumes, and build cache consume disk. Old images and orphaned volumes accumulate. Run docker system df to see usage.
- Can I safely prune Docker data?
- Yes. docker system prune removes stopped containers, unused networks, dangling images. docker volume prune removes volumes not used by any container. Check that no running containers need the volumes before pruning.
- When should I escalate Docker space issues?
- If the host disk is full (df -h shows 100%), prune Docker first. If that does not free enough, see fix-linux-runs-out-of-disk for host cleanup. Escalate if you cannot identify what is using space or cleanup is risky.
Rate this guide
Was this helpful?
Thanks for your feedback.