On this page
"No space left on device" is the error a Mac throws when a write fails because there's no room to put the data. The message comes from the system's ENOSPC code, and apps pass it along word for word, which is why you see the same sentence in Safari, Terminal, Homebrew and Docker.
It doesn't always mean the whole disk is full. The volume can be at its limit, a disk image like Docker's can be at its cap, or Safari's own cache can be stuffed or corrupted while Finder still shows plenty of free space. Which one you have depends on where the error appeared.
What the error actually means
A program asked macOS to save something, and macOS said no. The answer has three causes: the disk is full, a smaller container inside it is full (Docker's virtual disk, say), or the app has a broken cache and misreports it.
That's why the Storage screen in System Settings can look fine while the error keeps appearing. Where the error showed up tells you what is usually full:
| Where you saw it | What is usually full |
|---|---|
| Safari ("The error is: No space left on device") | Safari's cache or website data |
| Terminal, an installer or Homebrew | The startup volume |
| Docker | Docker's disk image, which has its own size limit |
| A Finder copy to an external drive or share | The destination disk, not your Mac |
Why does Safari say "no space left on device"?
Safari shows this error when its cache or website data is full or corrupted, and it can happen with hundreds of gigabytes free. The data lives in ~/Library/Caches/com.apple.Safari and ~/Library/Containers/com.apple.Safari. When that data goes bad, Safari fails to write to it and blames the disk.
Clearing it is the standard fix:
- Quit every Safari window, then reopen Safari.
- Open Safari > Settings > Privacy and click Manage Website Data, then Remove All. You'll be signed out of websites, but bookmarks and history stay.
- If you have the Develop menu turned on, choose Develop > Empty Caches as well.
- Quit Safari completely and open it again.
- If the page still fails, restart the Mac.
The error often shows up on one site only, usually a heavy one with a lot of stored data such as a web app or a video service. If it returns after a clear, check the Mac's real free space, because the cache may be refilling a disk that is nearly full.
Why does my Mac say storage is full when it's not?
Your Mac can report that it's out of space while Storage settings show room because some of that room is purgeable. Purgeable files and local Time Machine snapshots count as free in one view and as used in another, and macOS doesn't always release them quickly enough to satisfy a big write.
Two things help. A restart gives macOS the chance to clear purgeable data and thin its own snapshots. If that isn't enough, you can ask for a specific amount back by thinning snapshots yourself:
tmutil listlocalsnapshots /
sudo tmutil thinlocalsnapshots / 21474836480 4
The first command lists the snapshots. The second asks macOS to free about 20 GB by removing them, starting with the oldest. If Time Machine is set up, macOS creates a local snapshot every hour whether or not your backup drive is connected, so this clears space now without stopping new ones from forming. The full explanation of the gap between free and available storage is in purgeable space on Mac.
When the disk is full: find what filled it
If a restart and the snapshot step change nothing, the disk is full of real files. Guessing where doesn't work well, because the Storage bar lumps most of it into System Data and Finder hides the Library folder where the big offenders live.
In Terminal, this lists the folders in your Library by size, with the biggest last:
du -sh ~/Library/* 2>/dev/null | sort -h
Run it again inside the largest folder and keep going until you reach a specific app or cache. It takes a few rounds, and it can't see snapshots or swap.
DissectMac's Space Map does the same job in one view. It draws the drive as a treemap, with each folder sized by the space it uses, so the folder that filled your disk is the biggest block on screen. The scan is free.


Once you know which block is the problem, the rest follows from what it is. Caches, logs and leftovers from deleted apps can go. A 60 GB folder you don't recognize stays until you know what it is. If the block is mostly System Data, which is the grey segment of the Storage bar, the steps to clear System Data cover which parts are safe to remove.
"No space left on device" in Terminal, Docker and Homebrew
In developer tools the error often comes from a full container, not a full disk.
Docker's disk image is at its cap. Docker Desktop keeps everything in a single file, Docker.raw, with a size limit set in its settings. When images, containers and build cache fill that limit, builds fail with "no space left on device" even though your Mac has hundreds of gigabytes free. Pruning unused images and volumes, or raising the limit, fixes it, and the steps are in how to shrink Docker's disk on a Mac.
A volume is full, not the whole disk. If you're writing to an external drive, a disk image or a network share, the error refers to that volume. Check it with df -h and look at the row for the path you're writing to.
A big temp folder is a symptom, not a cause. /private/var/folders holds per-user caches and temporary files on the startup volume and has no size cap of its own, so it can't be full while the disk has room. It can only grow as far as the disk allows, and a normal restart clears its temporary files. Don't delete the folder by hand. A restart into Safe Mode clears system caches too, and a normal restart afterwards brings you back.
Homebrew or an installer fails mid-download. The temporary space it needs is bigger than what's left. Run brew cleanup to remove old downloads and versions, then try again.
When df -h shows the main volume at 100% rather than just one path, you're back to a full disk, and the earlier section applies.
How to stop it coming back
- Leave some free space as a buffer. When the disk is nearly full, macOS has less room to write caches and swap, and errors show up first.
- Plug in the backup drive and let a backup finish every few weeks, so the snapshot kept from your last backup doesn't grow large.
- Prune Docker's unused images, containers and volumes before the build cache gets large, or set the disk image size limit in Docker Desktop to something you can afford.
- Clear Safari website data every few months if you keep a hundred tabs and web apps open.
How do I fix "no space left on device" on a Mac?
To fix "no space left on device" on a Mac, first find where the error appeared. In Safari, clear Website Data in Safari's Privacy settings, empty caches from the Develop menu, then quit Safari and restart the Mac. If Storage looks free but the error persists, restart so purgeable space is released and thin local Time Machine snapshots with tmutil. If the disk is full, find the biggest folders and clear caches and app leftovers first. In Docker, prune images, containers and volumes or raise the disk image size limit in Docker Desktop, and in Terminal, check df -h for the volume that's actually full.
More guides
Free up space
How to Clear Storage on Mac: 12 Fixes That Work
How to clear storage on Mac when it's full: 12 ways to free up space, biggest wins first, including hidden folders Apple's Storage screen doesn't show.
Free up space
Fix “Scratch Disk Full” in Photoshop on Mac
Photoshop says the scratch disks are full on your Mac? Free up space, purge, add a scratch disk, and get Photoshop open again when it won't start.
Free up space
Docker.raw Is Huge on Mac: How to Shrink Docker's Disk
Why Docker.raw grows to 60 GB or more on a Mac and never shrinks, how to prune images and volumes, resize the disk image, and whether you can delete Docker.raw.
Free up space
Optimize Mac Storage: What It Does and Misses
Optimize Mac Storage moves old iCloud Drive files off your Mac. See what it does, whether to turn it off, and what it leaves behind, like System Data.