Docker / Docker

Docker no space left on device

Fix Docker no space left on device errors by cleaning unused images, containers, volumes, and build cache.

Category
Docker
Error signature
no space left on device
Quick fix
Inspect docker system df, then prune unused Docker resources that are safe to remove.
Updated

What this error means

no space left on device means Docker cannot use the local container runtime, a host resource, or a compose binding needed by this command. For this error, check daemon status, socket permissions, disk pressure, and port ownership before changing application code.

Why this happens

Docker errors often come from the host environment around the container, not from the application image itself.

For Docker no space left on device, the fastest path is to identify whether the failure is daemon access, storage, networking, or file permissions.

Quick fixes

  1. Run docker info to confirm the Docker client can reach the daemon.
  2. Inspect docker system df, then prune unused Docker resources that are safe to remove.
  3. Check whether the failing container, volume, port, or socket already exists.
  4. Restart Docker Desktop or the Docker service only after collecting the first error message.

Copy-paste commands

Check daemon access

docker info

List running containers

docker ps

Check Docker disk usage

docker system df

Find a process using port 3000

lsof -i :3000

Real-world fixes

Step-by-step troubleshooting

  1. Search the log for no space left on device and note the resource named next to it.
  2. Run docker info; if it fails, fix daemon access before debugging images or compose files.
  3. For port errors, run lsof -i :3000 with the actual port and stop the owning process or change the host port.
  4. For storage errors, run docker system df before pruning cache, images, or volumes.
  5. Retry the smallest failing Docker command after each change.

Platform-specific fixes

macOS

Linux

Windows

How to prevent it

FAQ

What should I check first?

Start with the exact no space left on device line and the command, request, or workflow step that produced it. In Docker, the first useful clue is usually near the first failure line, not the final stack trace.

Can I ignore this error?

No. Treat it as a failed Docker step. A temporary bypass may help diagnosis, but the underlying cause should be fixed before shipping or publishing changes.

Why does this work locally but fail elsewhere?

Local machines often have cached credentials, old dependencies, different runtime versions, or network settings that CI and production do not share. Reproduce from a clean shell or clean install when possible.

How do I know the fix worked?

Rerun the smallest command, request, or deployment step that produced no space left on device. The fix is working when that step completes without the same signature and produces the expected output.