Developer storage

Docker disk space on Mac: find it and reclaim it

Docker Desktop on a Mac runs a Linux VM and stores every image, container, volume and build cache in one disk image at ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw. Measure usage with docker system df, reclaim space with docker system prune and volume cleanup, and never delete Docker.raw while Docker is running.

Updated 2026-10-27

Key points

  • Docker Desktop is a Linux virtual machine; its disk image grows on demand and does not shrink automatically.
  • The current host path is ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw.
  • docker system df reports images, containers, volumes and build cache with a reclaimable column.
  • docker system prune -a removes unused images and build cache but leaves data volumes untouched.
  • Resetting or deleting the disk image frees all reclaimed space but destroys every image, container and volume.

Docker Desktop on macOS runs containers inside a Linux virtual machine, and that VM stores everything in one disk image. Images, containers, build cache and volumes all live inside that file, so Finder cannot tell you what is safe to remove. Use Docker’s own tools to measure and prune, and treat the disk image itself as a reset-only option.

Why Docker uses so much space

Each image is a stack of layers, and old tags keep their layers until nothing references them. Build cache adds storage, stopped containers keep writable layers, and volumes persist independently. The VM disk image grows on demand and does not shrink every time you delete something inside it, so the host file can stay large after docker system prune.

Where Docker stores data on macOS

In current Docker Desktop releases:

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

Older releases used other file names under ~/Library/Containers/com.docker.docker/Data, including a Docker.qcow2 disk. The safest way to locate the current file is to inspect that container directory rather than relying on a path from an old tutorial.

docker info prints a Docker Root Dir, usually /var/lib/docker. That path exists inside the Linux VM, not on your Mac. Files there are not directly accessible from Finder, and deleting the host disk image while Docker runs can corrupt the VM.

To see the host file size:

du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
ls -lh ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

du reports allocated blocks; ls -lh reports logical size. For a sparse file, these can differ.

Measure what Docker is using

docker system df
docker system df -v

The summary splits usage into images, containers, local volumes and build cache, with a reclaimable figure for each. The detailed view lists individual images and their shared sizes. Docker reports decimal units, so 1 GB means 1,000,000,000 bytes, not 1,073,741,824.

Prune what is unused

Start with the least destructive commands and read the prompt each one prints:

docker container prune
docker image prune
docker builder prune

docker container prune removes stopped containers. docker image prune removes dangling images only. docker builder prune clears build cache and makes the next build slower.

When you need more space:

docker image prune -a

This removes every image not referenced by a container, including images you might want later. Re-pulling them costs time and bandwidth.

docker system prune combines stopped containers, unused networks, dangling images and build cache. Adding -a includes all unused images. None of these commands removes volumes by default.

Remove unused volumes carefully

docker volume ls
docker volume prune

A volume can hold a database, uploads or other data that cannot be rebuilt from an image. Identify each volume before removing it. Recent Docker versions remove only anonymous volumes by default; docker volume prune --all includes named volumes. docker system prune -a --volumes is the broadest option and should be treated as destructive.

Reclaim the disk image itself

If pruning does not return space to macOS, reset the image:

  1. Quit Docker Desktop completely from the menu bar.
  2. Confirm no Docker process is running.
  3. Move Docker.raw to the Trash, or use Docker Desktop’s Troubleshoot > Clean / Purge data option.
  4. Start Docker Desktop and let it create a fresh image.

Every image, container, volume and build cache is gone after this. Docker Desktop’s Reset to factory defaults does the same thing and also resets settings.

You can set a maximum size under Settings > Resources > Advanced > Disk image size, and you can move the image to an external drive from the same panel. Changing the size is not a substitute for pruning, and lowering it may not shrink the existing file immediately.

Keep Docker small going forward

  • Use docker run --rm for one-off containers.
  • Remove containers when a task is finished instead of letting them accumulate.
  • Prefer multi-stage builds and slim base images.
  • Add a .dockerignore so build contexts do not include node_modules, .git or datasets.
  • Bind-mount large datasets from the Mac instead of copying them into an image, which keeps them out of the VM image.
  • Use docker compose down -v only when you intend to delete the project’s volumes.

How Maclean handles Docker storage

Maclean’s developer-cache scan reports Docker Desktop VM data, Docker cache and Docker BuildKit cache. The VM data directory is display-only because deleting its files directly corrupts Docker; cleanup has to go through Docker Desktop or the Docker CLI.

Where Docker is running, Maclean also shows the space reclaimable through docker system prune -a, and runs that prune only after confirmation. The CLI view:

maclean scan --tab dev-cache
maclean clean --tab dev-cache --dry-run

Developer-cache tabs delete permanently in the CLI, so use --dry-run first; large files and duplicates use the Trash and maclean restore <id>. The app adds a review screen and a 14-day trial, while the CLI is free and open source under Apache-2.0.

For the other large developer folders, see Xcode Derived Data and node_modules disk space.

Bottom line

Docker’s space is concentrated in one host file, but safe cleanup happens inside Docker: measure with docker system df, prune containers, images and build cache, and review volumes first. Reset the disk image only when you accept losing all Docker data, and never touch Docker.raw while the VM is running.

FAQ

Frequently asked questions

Where does Docker store data on a Mac?

Docker Desktop stores its Linux VM and all container data in ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw in current releases. Older versions used different file names under the same container directory. The path is on the host, not inside the Linux VM.

Why does Docker.raw stay large after I delete images?

Pruning frees blocks inside the Linux filesystem, but Docker Desktop does not always return those blocks to macOS immediately. The host file can remain close to its previous size. Resetting the disk image is the reliable way to shrink it, and it removes all Docker data.

Is docker system prune safe?

It is safe for images and build cache you can rebuild or pull again. It removes stopped containers, unused networks, dangling images and build cache by default. Adding -a removes all images not used by a container, and adding --volumes removes volume data, which can include databases.

Can I move Docker's disk image to an external drive?

Yes. Docker Desktop's Settings > Resources > Advanced includes a disk image location option. Point it at an external volume and apply the change. Keep the drive connected while Docker runs, and expect much slower I/O on a USB drive.

Does uninstalling Docker Desktop delete Docker.raw?

Not always. The data directory can remain after the app is removed, which leaves tens of gigabytes behind. Check the container path after uninstalling and remove it only if you no longer need any Docker data.

Preview first, then clean safely

Maclean breaks down caches, app data, large files and APFS snapshots, and labels the risk of every item before deletion.

Download for Mac→