Docker Desktop Taking Up Space on Mac: What's Safe to Delete

Yes, but read this firstDiskmack safety tier: Caution
~/Library/Containers/com.docker.docker~/.docker

Yes, you can get most of that space back, but do not drag anything to the Trash yet. Docker Desktop keeps images, containers, and volumes inside one virtual disk at ~/Library/Containers/com.docker.docker, and deleting that folder wipes your volumes for good. The right move is to prune from inside Docker, which is safe and usually recovers the bulk of the space.

What it is

Docker Desktop on a Mac runs a Linux virtual machine, and everything Docker touches lives inside that VM's virtual disk. The disk is a single file, Docker.raw, buried in ~/Library/Containers/com.docker.docker. Every image you pull, every container you run, every volume, and every layer of build cache lands in there. The file grows as you work and never shrinks on its own, which is why Docker is often the single largest item on a developer's Mac: tens of gigabytes is normal, and heavy compose setups can pass 100 GB.

The second folder, ~/.docker, is the Docker CLI's home. It holds config.json with your registry logins, buildx state, and scan caches. It is usually small next to the VM disk, though buildx caches can add up if you do a lot of multi-platform builds.

Is it safe to delete?

Do not delete either folder in Finder while Docker is installed. Removing ~/Library/Containers/com.docker.docker destroys everything at once: images, containers, and volumes. Images can be pulled again from their registries, but volumes and container data exist only on your machine, and once they are gone they are gone. If a Postgres database or anything else you care about lives in a Docker volume, deleting this folder is how you lose it.

The safe path is to clean from inside Docker. Running docker system prune removes stopped containers, dangling images, unused networks, and build cache while leaving volumes untouched. ~/.docker is a different case: its caches rebuild, but config.json holds your registry logins and CLI settings, so deleting the whole folder means signing in and setting things up again. Diskmack identifies Docker Desktop's storage automatically and cleans it the safe way, through Docker's own tooling rather than the Finder.

How to check its size

In Finder: Open Finder, press Command-Shift-G (or choose Go > Go to Folder), paste ~/Library/Containers/com.docker.docker and press Return. Select the folder and press Command-I to see its size. Repeat with ~/.docker to check the CLI folder.

In Terminal:

du -sh ~/Library/Containers/com.docker.docker ~/.docker

The ~ expands to your home folder automatically; neither path contains spaces, so no quotes are needed.

How to clean it

  1. Open Docker Desktop and wait for it to finish starting.
  2. Click Containers in the left sidebar and delete any stopped containers you no longer need.
  3. Click Images, sort the list by size, and remove images you no longer use with the trash icon.
  4. Click Volumes and review each volume before deleting. Volumes hold real data, like database contents, so only remove ones you are sure about.
  5. For a full reset, open the Troubleshoot menu (the bug icon in the top bar) and choose Clean / Purge data. This empties the entire VM disk, volumes included, so treat it as a last resort.

The official way: this tool ships its own cleanup command, which handles locks and indexes correctly.

docker system prune

docker system prune skips volumes by default. Adding --volumes removes unused anonymous volumes as well (older Docker versions removed unused named ones too), so only use that flag if you are certain nothing you need lives in a volume.

Will it come back?

Yes. Every image you pull and every build you run writes into the same virtual disk, so the space fills back up at whatever pace you use Docker. A prune every few weeks keeps it in check. There is also a disk usage limit under Settings > Resources > Advanced, but treat it as a preventive setting: raising it is harmless, while shrinking it makes Docker recreate the disk image and wipes your images, containers, and volumes. Docker warns you before it does that, so read the dialog.

Common questions

Can I just delete the com.docker.docker folder in Finder?

Only if you are removing Docker entirely and accept losing every volume. Even then, uninstall through Docker Desktop (Troubleshoot > Uninstall) so it cleans up its other pieces properly. If you plan to keep using Docker, prune instead.

Why does Docker.raw still look huge after I deleted my images?

Docker.raw is a sparse file: it claims the VM disk's full size up front, but only the blocks actually written take up room on your drive. Finder often reports the headline number. Run du -sh on the folder to see what it really occupies. Recent Docker Desktop versions hand freed space back to macOS shortly after a prune; older versions needed a restart first.

Does docker system prune delete my volumes?

No. By default it removes stopped containers, unused networks, dangling images, and build cache. Adding --volumes removes unused anonymous volumes, the ones with long random names. On current Docker versions named volumes survive even that; you have to remove those yourself in Docker Desktop or with docker volume rm.

Is it safe to delete ~/.docker?

Mostly, but it is rarely worth the trouble. The caches inside rebuild on their own, and the folder is small next to the VM disk. Deleting it also removes config.json, so you would have to sign in to your registries again and redo any CLI settings.

Related folders