Is it safe to delete Docker.raw?
- No, not as a way to free space. Docker.raw is the disk of Docker Desktop’s Linux virtual machine. Deleting it removes every image, container and volume at once, databases kept in volumes included, and it must never be deleted while Docker is running.
- What it costs you: freeing space the right way, with Docker’s own prune commands, costs only images and build cache that download or build again. Deleting the file costs everything inside it.
- Does it come back? Docker Desktop starts again with an empty disk. What was in it doesn’t come back.
- SiftMac’s verdict: You decide
1. What it is
Containers need Linux, so Docker Desktop for Mac runs a small Linux virtual machine, and Docker’s documentation describes how it stores Linux containers and images in a single large disk image file. That file is Docker.raw. Everything Docker keeps lives inside it:
- Images you pulled or built. They download or build again.
- Build cache, which makes the next build faster and refills as you build.
- Containers, running and stopped, with anything written inside them.
- Volumes: databases, uploads and other data your containers keep. Often the only copy.
Docker.raw has a maximum size, and only takes the space it has actually used up to that maximum. Docker’s FAQ warns that some tools report the maximum instead of the real usage, which is why the file can look far bigger in Finder than the space it really takes.
2. Where it is
~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
That’s the path in Docker’s own example. Docker Desktop shows the real location, the maximum size and the space actually used in Settings › Resources › Advanced, and that’s also where you move it, with the disk image location setting. Docker says not to move the file in Finder, because Docker Desktop can lose track of it.
3. How big it gets
It grows as you pull images, build and run containers, up to the limit set in Docker Desktop. Ask Docker what’s inside and how much it could give back (Docker Desktop must be running):
docker system df
docker system df -v
The RECLAIMABLE column is what pruning would free. To see what the file really occupies on your disk rather than its maximum, as Docker’s FAQ does:
ls -klsh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
4. How to delete it safely
Free space inside the file with Docker’s own commands, with Docker Desktop running:
docker system prune
docker image prune -a
docker builder prune
docker system pruneremoves stopped containers, unused networks, dangling images and build cache. It asks first, and volumes aren’t pruned.docker image prune -aremoves every image no container uses. They download or build again when you need them.docker builder pruneclears build cache only.
Volumes only go if you ask: docker system prune --volumes adds unused anonymous volumes, and named volumes are only removed by docker volume prune -a. Run docker volume ls and back up anything you need before using either.
Docker’s FAQ notes that space is only freed when images are deleted, and gives a command that makes Docker hand the freed space back to macOS straight away:
docker run --privileged --pid=host docker/desktop-reclaim-space
To stop the file growing as large again, lower the disk limit in Settings › Resources › Advanced. Docker warns that lowering it deletes the current disk image, so every container and image in it is lost: prune and back up first.
To start from empty on purpose, use Docker Desktop’s own reset, Troubleshoot › Clean up data, which destroys all containers and images and keeps your settings. Never delete Docker.raw while Docker Desktop is running.
5. What happens afterwards
- After a prune: containers you start again pull or rebuild their images, the next build is slower while the cache refills, and your volumes are as you left them.
- After Clean up data, or a deleted Docker.raw: Docker starts with an empty disk. Every image is pulled again, and anything in containers or volumes is gone unless you backed it up.
- Either way, the file grows again as you work, up to the limit you set.
Questions
Why does Finder show Docker.raw much bigger than Docker says?
Docker.raw has a maximum size, and some tools show that maximum instead of the space actually used. ls -klsh on the file, or Docker Desktop’s Settings › Resources › Advanced, shows the real usage.
Does docker system prune delete my volumes?
No. Volumes aren’t pruned unless you add --volumes, and even then only unused anonymous volumes go. Named volumes need docker volume prune -a.
Can I delete Docker.raw after uninstalling Docker Desktop?
Yes, once you’re sure you don’t need anything in its volumes: without Docker Desktop, nothing uses it. Export any volume data you want to keep before you uninstall, while Docker can still read it.
How SiftMac handles it. With Include Docker turned on in Settings, its Developer files category lists unused images, build cache and stopped containers with the sizes docker system df reports, and frees them with Docker’s own prune commands; volumes are never touched. Under System Data it shows Docker’s disk image as a whole, explained but never removed.
Download SiftMac · scanning is free, and so is your first 2 GB of cleaning · See how it works