Fix No Space Left on Device on Coolify

Error: ENOSPC: no space left on device

The server ran out of disk during a build or deploy, so the step fails (npm ENOSPC, image pull/build failure, or a container won't start).

Coolify and Docker accumulate data fast: old images, stopped containers, dangling layers, and build cache pile up under /var/lib/docker, while Coolify's own files sit under /data. Every deploy builds a new image, so on a small root volume the disk fills and builds die with 'npm ERR! code ENOSPC ... no space left on device' or image-pull errors. VPS/EC2 boxes with a small root partition hit this quickly.

The fix

  1. Check what's actually full so you fix the right volume. Look at the filesystem holding /var/lib/docker and what Docker says it can reclaim.

    df -h && docker system df
  2. Run Coolify's built-in cleanup first (the safe move). In the dashboard go to Servers > your server, and trigger a cleanup. Coolify prunes unused images, stopped containers, and build cache for you.

  3. If you need more space, prune from the CLI over SSH. This removes all unused images, stopped containers, and build cache. Read the confirmation prompt before saying yes.

    docker system prune -a
  4. Do NOT add --volumes blindly: that deletes volumes not attached to a running container and can wipe a stopped database. Only prune volumes if you are certain they are disposable.

  5. Prevent recurrence: enable scheduled cleanup in Servers > your server > Configuration > Advanced. Set the Docker Cleanup Threshold (e.g. 80%) and a Docker Cleanup Frequency cron schedule, and enable Force Docker Cleanup for reliable runs (cleanup is skipped automatically during an active deployment). If the box is just too small, grow the disk to 50-100GB so /var/lib/docker isn't on a tiny root partition.

Verify it worked

df -h shows healthy free space on the filesystem holding /var/lib/docker and /data, and the deploy completes without ENOSPC.

df -h /var/lib/docker /data

Related Coolify errors

Have Emsden Studio fix it for you — from A$149

All Coolify deploy errors