Developer cleanup

Docker.raw Is Eating My Mac's Disk: How to Shrink Docker Desktop in 2026

You open Disk Utility or check your storage in System Settings and find a suspicious chunk of space labelled "System Data" — then you dig deeper and discover a single file, Docker.raw, sitting at 60 GB, 80 GB, or more. If docker.raw is taking up space on your Mac and you want it back, this guide explains exactly why that file balloons, which commands safely free space inside it, and how to shrink the virtual disk on the macOS side.

What Is Docker.raw (and Docker.qcow2)?

Docker Desktop for Mac runs Linux containers inside a lightweight virtual machine managed by Apple's Virtualization framework (or, on older Macs, HyperKit). Because macOS cannot run Linux containers natively, Docker needs a Linux disk image to store container layers, volumes, and images. That disk image lives at:

~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

On older Docker Desktop versions (pre-4.x) you may see Docker.qcow2 in a similar path. Both serve the same purpose — a virtual disk file that the Linux VM reads and writes to as if it were real storage.

The file uses sparse allocation on the host: macOS only allocates real disk blocks as they are written. However, when you delete data inside the VM (remove images, containers, volumes), the Linux filesystem marks those blocks as free — but it does not automatically tell macOS to deallocate them. The result is a file that grows steadily and almost never shrinks on its own.

Find the Exact Size Right Now

Open Terminal and run:

du -sh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

Compare that to what Finder reports — they will often differ because du shows actual used bytes while Finder shows the allocated size. Both numbers matter: the allocated size is what macOS is reserving on your SSD.

If you use Crumb's whole-Mac audit (Visualize tab → full scan), it surfaces the Docker.raw file inside the treemap and flags it when it exceeds a configurable threshold. Hovering it shows the "Is this safe to delete?" explanation: Crumb will tell you this file is the Docker Desktop virtual disk, what deletes it means, and that you should prune Docker first before removing it — exactly the context you need before taking action.

Step 1 — Prune Space Inside the Docker VM

Before you touch the file on the macOS side, reclaim space inside the VM. This frees blocks that the later shrink step can then reclaim.

  1. Open a Terminal window and make sure Docker Desktop is running.
  2. Remove stopped containers, dangling images, unused networks, and the build cache:
    docker system prune --all --volumes
    Warning: the --volumes flag deletes all unused named volumes. If any volumes contain data you need (databases, persistent app state) remove that flag or back up the data first. This action is permanent and cannot be undone.
  3. Confirm what will be removed when prompted with y.
  4. Check how much space was freed inside the VM:
    docker system df

Typical savings from a docker system prune --all range from a few hundred megabytes to many gigabytes, depending on how many old images and build caches have accumulated. The Docker.raw file size on disk will not drop yet — that comes next.

Step 2 — Reclaim Space from the Docker.raw File on macOS

Freeing space inside the VM does not automatically shrink the host file. You need to trigger a reclaim operation. Docker Desktop provides a built-in way to do this.

Option A: Use Docker Desktop's Built-In Disk Reclaim (Recommended)

  1. Open Docker Desktop.
  2. Go to Settings → Resources → Disk image location.
  3. Click "Clean / Purge data" or look for a "Reclaim disk space" button (the exact label varies by Docker Desktop version; it appeared in Docker Desktop 4.15+ on the Resources pane).
  4. Wait for the operation to complete. Docker will restart the VM in the process.

This is the safest path because Docker orchestrates the shrink itself, ensuring the VM is stopped cleanly before the file is resized.

Option B: Reset the Virtual Disk (Nuclear Option)

If the reclaim button does not bring the file down to an acceptable size, you can reset the virtual disk entirely. This deletes all images, containers, and volumes.

  1. In Docker Desktop, go to Settings → Troubleshoot.
  2. Click "Reset to factory defaults" or "Clean / Purge data".
  3. Confirm the reset. Docker will create a fresh, small Docker.raw.
  4. Re-pull only the images you actually use: docker pull <image>.

Option C: Manually Delete the File (Last Resort)

If Docker Desktop is uninstalled or you want a completely fresh start:

rm -rf ~/Library/Containers/com.docker.docker

This removes Docker Desktop's entire data directory, including all images, containers, and volumes. Only do this if you have either removed Docker Desktop entirely or are prepared to reconfigure it from scratch. Never delete Docker.raw while Docker Desktop is running — doing so will corrupt the VM.

Limit How Large Docker.raw Can Grow

By default Docker Desktop sets a generous maximum disk size (often 64 GB or more). You can cap it to prevent future sprawl:

  1. Open Docker Desktop → Settings → Resources.
  2. Drag the Disk image size slider down to a value appropriate for your workload (32 GB is reasonable for most developers).
  3. Click Apply & Restart.

Docker will shrink or reallocate the virtual disk to the new maximum. If your current usage exceeds the new limit, Docker will warn you before applying.

Other Docker Files Worth Checking

Path What it contains Safe to delete?
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw Linux VM virtual disk (images, containers, volumes) Only after stopping Docker and running prune; deletes all local data
~/Library/Containers/com.docker.docker/Data/log/ Docker Desktop daemon and VM logs Yes — logs are regenerated; safe to clear when Docker is stopped
~/Library/Group Containers/group.com.docker/ Settings, credentials, extensions config No — removing resets your Docker Desktop configuration
~/.docker/ CLI config, registry credentials, contexts No — removing resets login state and CLI config

Prevent Docker.raw from Growing Back

  • Add a prune alias. Put this in your ~/.zshrc: alias dprune='docker system prune --all'. Run it monthly.
  • Use multi-stage builds. Smaller final images mean fewer layers stored in the VM.
  • Pull with explicit tags. Avoid pulling :latest repeatedly without removing old versions — old layers accumulate silently.
  • Set the disk size cap as described above, so Docker cannot creep past a reasonable limit even if you forget to prune.
  • Schedule a regular audit. Tools like download Crumb and run a whole-Mac scan periodically — the treemap view makes it obvious when Docker.raw (or any other large file) has grown out of proportion again, before it becomes a crisis.

Conclusion

The docker.raw file taking up space on your Mac is a structural consequence of how Docker Desktop virtualizes Linux storage: the file grows with every pulled image and build cache, but never automatically gives space back to macOS when you delete things inside Docker. The fix is a two-step process — prune inside the VM first with docker system prune --all, then trigger a reclaim or disk reset from Docker Desktop's Settings. Cap the maximum disk size afterward and add a monthly prune habit to keep it under control. If you want a quick way to spot oversized files like Docker.raw across your whole Mac before they sneak up on you, Crumb's treemap audit makes that a one-click job.

Reclaim your disk in one click

Crumb audits your whole Mac, tells you what's safe to delete, and frees the space in seconds — private, local, and Apple-notarized.

Download Crumb for macOS

Frequently asked questions

Is it safe to delete Docker.raw directly in Finder?
Only if Docker Desktop is fully stopped and you understand that deleting Docker.raw erases all local images, containers, and volumes. It is safer to use Docker Desktop's built-in 'Reclaim disk space' or 'Reset to factory defaults' option, which handles the deletion cleanly and rebuilds a fresh virtual disk on next launch.
Why does docker system prune not shrink the Docker.raw file?
docker system prune frees space inside the Linux VM's filesystem, but the Docker.raw file on macOS is a virtual disk image. Freed blocks inside the VM are not automatically returned to macOS until you run Docker Desktop's built-in reclaim operation, which compacts the sparse file and deallocates the now-unused host blocks.
How do I find out what is inside Docker.raw without deleting it?
Run 'docker system df' in Terminal to see a breakdown of how much space images, containers, local volumes, and the build cache are consuming inside the VM. This tells you what is safe to prune before you commit to any deletion.
What is a reasonable maximum size for Docker.raw?
For most developers doing routine work — pulling a handful of images, running local services — 32 GB is a comfortable cap. Data-heavy workflows (large ML images, many simultaneous services) may need 50-64 GB. Set the limit in Docker Desktop under Settings → Resources → Disk image size so the file cannot silently grow past your chosen boundary.