Docker 'No Space Left on Device' or Insufficient Disk Space
This error matches known, documented patterns with reliable solutions.
Quick Fix (Most Common Solution)
- Check what is consuming space: docker system df
- Safe prune — removes stopped containers, unused networks, and dangling images: docker system prune
Seeing "no space left on device"? This error can be frustrating, but it's usually fixable. It typically affects your development workflow or system. Below you'll find clear, step-by-step solutions to resolve this issue.
What This Error Means
Docker has exhausted the disk space allocated to its storage driver. On Linux, this consumes real filesystem space in /var/lib/docker. On Mac and Windows, Docker's virtual disk file (.raw or .vmdk) has reached its configured size limit.
Frequently documented in developer and vendor support forums.
Not affiliated with browser, OS, or device manufacturers.
New here? Learn why exact error messages matter →
Common Causes
- Stopped containers accumulate and consume disk space over time
- Unused images (dangling and untagged) build up with each docker build
- Build cache grows significantly with repeated docker build runs
- Docker's virtual disk file on Mac/Windows has reached its configured size limit
How to Fix
- Check what is consuming space: docker system df
- Safe prune — removes stopped containers, unused networks, and dangling images: docker system prune
- More aggressive prune — also removes unused volumes (data loss if volumes contain data): docker system prune --volumes
- Remove all unused images including tagged ones: docker image prune -a
- On Mac/Windows: increase the disk image size limit in Docker Desktop Settings > Resources
Last reviewed: June 2026 How we review solutions
Didn't fix it? Get a personalised solution
Environment-Specific Commands
Linux / macOS / Windows — Incremental Cleanup
docker system dfdocker system prunedocker image prune -adocker system prune --volumes
macOS / Windows — Increase Docker Disk Limit
# Open Docker Desktop# Go to Settings > Resources > Disk image size# Drag the slider or enter a larger value# Click Apply & Restart
Quick Diagnostic Path
- If docker system df shows large BUILD CACHE → Run: docker builder prune to clear only the build cache without touching images
- If Many images but docker system prune did not help → Run: docker image prune -a — this removes ALL unused images, not just dangling ones
- If Mac/Windows and error persists after pruning → Disk file is at its maximum — increase the limit in Docker Desktop > Settings > Resources
- If Linux and real disk is full → Check which partition Docker uses: df -h /var/lib/docker
If This Still Fails, Check
- On macOS, pruning frees space inside Docker's virtual disk but does not shrink the .raw file itself — only increasing the configured limit and re-pruning helps
- Named volumes (docker-compose volumes with explicit names) are NOT removed by docker system prune — use docker volume ls and docker volume rm explicitly
- CI/CD pipelines: add docker system prune -f as a cleanup step between builds to prevent gradual disk exhaustion on CI runners
Check and reclaim Docker disk space
# Step 1: see what is using space
docker system df
# Step 2: safe prune (stopped containers, dangling images, build cache)
docker system prune
# Step 3: if still not enough — remove ALL unused images
docker image prune -a
# Step 4: include volumes if safe to do so
docker system prune --volumes
# Verify space was reclaimed
docker system dfEnvironment Differences
Why No Space Left On Device Behaves Differently in Docker vs Local Development
No Space Left On Device frequently appears only in Docker environments because containers are isolated from the host system — they cannot use the host's DNS, filesystem mounts, or network interfaces without explicit configuration.
The most common Docker-only cause: services communicate by container name (e.g., postgres) on a user-defined network, but the container attempting the connection is on a different network or the default bridge network. On user-defined networks, Docker provides DNS resolution between containers. On the default bridge network (bridge0), it does not. Run docker network ls and docker inspect <container> | grep -i network to verify both containers share a network. A second Docker-specific cause: /etc/hosts entries on the host are not visible inside containers — if you rely on local hostname overrides for development, add them via --add-host in docker run or the extra_hosts key in Compose.Optional follow-up
Some users ask whether saving fixes for recurring errors would be useful when the same issue appears again.
Was this explanation helpful?
Frequently Asked Questions
What does 'docker system prune' remove?
By default it removes: all stopped containers, all unused networks, all dangling images, and the build cache. It does NOT remove named volumes or images that are referenced by a tag.
Will I lose my data?
docker system prune is safe for data in running containers and named volumes. Use --volumes only if you are certain you do not need that volume data.
How do I prevent this from happening again?
Run 'docker system prune -f' regularly in a cron job, or add it as a cleanup step in your CI/CD pipeline after each build.
Related Resources
Also Known As
- Docker container error
- Docker build failure
- Container runtime error
- Docker daemon error
Common Search Variations
- "docker container won't start"
- "docker build error fix"
- "docker image not found"
- "container exited with error"
- "docker daemon not responding"
- "fix docker network error"
Related Errors
Still Stuck?
Paste a different error message or upload a screenshot to get help instantly.