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.

Category
Troubleshooting · Containers
Time
10–20 min
Last reviewed
What you'll need
  • Docker installed and running
  • sudo or root (for host df if needed)

Step-by-step diagnostic

Step 1 of 5
Show full guide

Steps

Goal: Check Docker disk usage, prune unused data, and free space.

  • Run docker system df to 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 -h on 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 prune to remove stopped containers.
  • Run docker image prune -a to remove unused images.
  • Run docker system prune -a to remove stopped containers, unused networks, and all unused images. Add -v to include volumes—check that no running containers need them first.
  • Run docker volume prune to remove volumes not used by any container.
  • Run docker builder prune -a to 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 df shows reduced usage and reclaimable space is low.
  • df -h on 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.

  1. docker system df Run docker system df to see usage.
  2. Prune containers and images docker container prune; docker image prune -a.
  3. docker system prune docker system prune -a; add -v for volumes if safe.
  4. docker volume prune docker volume prune; check no running containers need volumes.
  5. 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.

Run `docker system df` and `df -h`. Docker reclaimable: run docker system prune and docker volume prune. Host full: see fix-linux-runs-out-of-disk. Both: prune Docker first, then check host.

You can change your answer later.

Run docker system df

See images, containers, volumes, build cache.

Run `docker system df`. Note RECLAIMABLE. Good: you see what to prune. Proceed to Prune. Bad: no reclaimable—check host with df -h.

You can change your answer later.

Prune containers, images, volumes

docker system prune -a; docker volume prune.

Run `docker system prune -a` to remove stopped containers and unused images. Run `docker volume prune` if no running containers need the volumes. Good: space freed. Bad: host still full—see fix-linux-runs-out-of-disk.

You can change your answer later.

Host disk full?

df -h shows 100% on root or /var.

Run `df -h`. If host is full, see fix-linux-runs-out-of-disk for logs, temp, packages. Prune Docker first—it may free enough. Good: host has space—Docker prune should work. Bad: host full—escalate or host cleanup.

Done

Docker has free space. Monitor with docker system df.

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.

Continue to