How do I free up Docker disk space on Mac?

To free up Docker disk space on Mac, prune unused images, stopped containers and build cache, then reclaim the host space the VM gave back. Docker stores everything in one virtual disk at ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw. GRUJ scans Docker via the docker CLI, clears only orphaned images, volumes and build cache, and never runs a blind --volumes wipe. Devs commonly get 20-50 GB back.

Download free brew install --cask fan2dev/tap/gruj

3 months free · no card · direct download (outside the App Store)

Why is Docker.raw so big on my Mac?

Docker Desktop doesn't put images on your macOS filesystem. It runs Linux inside a lightweight VM and stuffs every image, container and volume into a single virtual disk: Docker.raw. That file is sparse — Finder and ls -alh show the maximum allocated size (64 GB by default), while du -h shows what it actually uses. The disk only grows: images, layers, volumes and build cache pile up and it never shrinks on its own. After weeks of active dev, 50 GB+ is common — one real build cache hit 648 entries / 30.98 GB, all reclaimable. And here's the trap: docker system prune can free space inside the VM without the Docker.raw file on your host shrinking at all.

01

gruj scan

GRUJ checks if Docker Desktop is running (the VM must be alive for the CLI to answer), then reads docker system df: reclaimable images, stopped containers, dangling layers and build cache, each with its real size. It locates Docker.raw and shows allocated vs. actual disk too.

02

Pick what to clear

Toggle by type — unused images, stopped containers, dangling build cache. GRUJ never selects named volumes by default, because a blind docker system prune -a --volumes is exactly what destroys database data. You keep what's running and your data, and drop the junk.

03

Confirm, then reclaim

On confirm, GRUJ prunes only orphaned artifacts via docker. Because pruning often doesn't shrink Docker.raw, GRUJ then triggers the official reclaim step (docker/desktop-reclaim-space) so the freed space actually returns to your host — no destructive slider, no data loss.

It knows Docker is a VM, not a folder

Generic Mac cleaners treat Docker.raw as one giant blob they can't safely touch. GRUJ talks to the docker CLI, so it distinguishes deleting inside the VM from reclaiming space on the host — the exact thing that confuses devs about Docker on Mac.

Prunes the right targets

Unused images (docker image prune -a), stopped containers, dangling layers and build cache (docker builder prune). GRUJ reads the RECLAIMABLE column from docker system df so you see what's actually recoverable before anything goes.

Reclaims the Docker.raw space

Pruning frees space inside the VM but the host file often stays huge. GRUJ runs docker run --privileged --pid=host docker/desktop-reclaim-space — the official command — so the disk you got back shows up on macOS, in seconds with the .raw format.

Never blind-wipes your volumes

docker system prune -a --volumes deletes named volumes — your Postgres data, your Redis dumps — without announcing what they contain. GRUJ's regenerable-only model never does that. Volumes are opt-in, after you confirm they hold nothing you want.

Build cache, kept sane

Build cache speeds up rebuilds, so nuking all of it hurts. GRUJ surfaces total cache size and lets you clear it, the equivalent of docker builder prune --reserved-space 5g (the current flag that replaced --keep-storage) — keep recent cache, drop the stale bulk.

One scan, every stack

The same scan also sweeps Xcode DerivedData, the Gradle cache, Flutter .pub-cache and node_modules. Docker is one axis of a two-axis model — by tool and by type — that only ever deletes regenerable paths, never your source or data.

docker prune by hand vs GRUJ

GRUJ docker prune (a mano)
See what's reclaimable Reads docker system df, shows GB per type up front docker system df -v, then read it yourself
Prune unused images & cache Cleared on confirm, only orphaned artifacts docker system prune -a (leaves running images)
Shrink the Docker.raw file Runs docker/desktop-reclaim-space automatically prune alone often doesn't shrink it — manual step
Named volumes (DB data) Never wiped blind — opt-in after confirm --volumes deletes them with no warning
Risk of losing data Low — regenerable-only allowlist, confirm step High — one --volumes flag nukes your databases
Docker + Xcode + node at once Yes, one scan across all stacks No — a separate command per tool

FAQ

How do I free up Docker disk space on Mac?

Run docker system prune to clear stopped containers, dangling images and build cache, or docker image prune -a for all unused images. Then run docker run --privileged --pid=host docker/desktop-reclaim-space to actually shrink the Docker.raw file on your host. GRUJ does all of this in one scan and never wipes your named volumes.

Where does Docker store data on Mac?

Docker Desktop stores everything in a single virtual disk at ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw (or Docker.qcow2 on older setups). You can see the exact path in Docker Desktop under Settings → Resources → Advanced → Disk image location.

Why is Docker.raw so big and why doesn't ls match du?

Docker.raw is a sparse file. ls -alh and Finder report the maximum allocated size (64 GB by default), which stays constant even on a fresh install with no images. du -h reports the actual disk used. The difference is normal, but macOS uses the allocated max for its own space accounting, so the bloat is real to you.

Why didn't docker system prune free space on my Mac?

Because pruning frees space inside the Linux VM, but the Docker.raw file on macOS often does not shrink automatically. To force the host to reclaim that space, run docker run --privileged --pid=host docker/desktop-reclaim-space. With the .raw format the space comes back in seconds; with .qcow2 a background process reclaims it after a few minutes.

How do I reduce Docker.raw size without losing my images?

Prune unused artifacts (docker system prune, docker builder prune --reserved-space 5g) and then run docker/desktop-reclaim-space — that shrinks the file while keeping your images. Do NOT lower the 'Disk image size' slider in Settings → Resources → Advanced: Docker's own docs warn that reducing the maximum size deletes the disk image, so all containers and images are lost.

Is it safe to clean up Docker on Mac?

Yes, if you avoid docker system prune -a --volumes run blind — that deletes named volumes (databases, persisted data) without telling you what's inside. Pruning unused images, stopped containers and build cache is safe; they're regenerable. GRUJ only clears orphaned artifacts on its allowlist and never wipes volumes without you opting in and confirming.

What's the best way to free up Docker space on Mac?

The safest, fastest way is: check docker system df, prune unused images and build cache, then reclaim the host with docker/desktop-reclaim-space — and never run a blind --volumes wipe. By hand that's three or four commands; GRUJ does it in one scan, shows the real GB per type before deleting, reclaims the Docker.raw space for you, and protects your volumes.

Will cleaning Docker delete my containers or database volumes?

No, not with GRUJ. It clears only orphaned images, stopped containers and build cache, and never selects named volumes by default. Your running containers and any volume holding data you care about are left untouched unless you explicitly opt in and confirm.

Get those 20-50 GB Docker is hiding back

Scan Docker through its own CLI, prune the orphaned junk, reclaim the Docker.raw space on your host — and never touch your database volumes. Free for 3 months, no card. macOS 13+, Apple Silicon and Intel.

Download free