What the file is and where it lives
Docker on Linux keeps its data in /var/lib/docker. Docker Desktop for Mac runs that engine in a Linux virtual machine instead, and the machine’s disk is one large file: by default ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw. Docker Desktop’s Settings → Resources → Advanced page shows its location, its maximum size and the space it actually consumes. Older installs used a Docker.qcow2 file instead.
Because everything Docker stores is inside, the file holds your volumes too, including any local databases. Docker Desktop’s General settings have an Include VM in Time Machine backups option, off by default, so unless you turned it on, Time Machine isn’t backing that data up.
1. Check how much space it really uses
Docker.raw is a sparse file: it claims its full maximum size, but disk blocks are only allocated as Docker writes data. ls -lh shows the maximum, which can look alarming. du -h shows the blocks actually allocated, which is what it costs your Mac. Docker’s FAQ uses ls -klsh, whose first column is the allocated size in kilobytes, next to the maximum.
Docker’s FAQ also warns that many tools report the maximum file size rather than the actual one. If a disk analyzer shows Docker.raw at hundreds of gigabytes on a Mac that doesn’t have that much used, compare with du and with available space in System Settings → General → Storage before drawing conclusions.
cd ~/Library/Containers/com.docker.docker/Data/vms/0/data
ls -lh Docker.raw
du -h Docker.raw
ls -klsh Docker.raw2. Shrink the contents with Docker commands
To make the file use less of your Mac, remove things inside it. docker system df -v shows what the space belongs to; the guides linked below cover images, containers, volumes and build cache one by one. Docker’s FAQ says space is reclaimed on the host within a few seconds for Docker.raw, and after a few minutes by a background process for Docker.qcow2.
Deleting files inside a running container doesn’t free host space on its own; only deleting Docker objects does. The FAQ gives a command that triggers reclamation at any point. Measure with du again afterward: the allocated size should drop, while ls keeps showing the same maximum.
docker system df -v
docker run --privileged --pid=host docker/desktop-reclaim-space
du -h ~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw3. Change its size limit or location in Settings
Open Docker Desktop → Settings → Resources → Advanced. The disk size control, labelled Disk usage limit in current releases and Disk image size with a slider in older ones, sets the maximum. Raising it is harmless. Lowering it is not: Docker’s FAQ states that reducing the maximum deletes the current disk image, and with it all containers and images. Back up volumes before you do it.
To move the file to a bigger drive, use Disk image location → Browse, choose the new folder and select Apply. Don’t drag Docker.raw in Finder; Docker warns that it can lose track of the file. If you move it to an external drive, keep that drive connected whenever you use Docker Desktop, because every image and volume now lives there.
Clean up data and factory reset are last resorts
Docker Desktop’s Troubleshoot menu, reached from the Docker menu in the menu bar or the question mark icon near the top right of the Dashboard, offers Clean up data, called Clean / Purge data in some older versions. It resets all Docker data without a full factory reset, and Docker’s documentation notes that existing settings are lost too. Reset to factory defaults returns every option to its first-install state.
Both erase your images, containers and volumes, and so does deleting Docker.raw by hand. Nothing moves to the Trash, and nothing can be recovered afterward. Use them only when Docker Desktop won’t work otherwise, after exporting any volume that holds data you need.
Where overlay2 lives on a Mac
On a Linux server, Docker’s classic storage driver keeps image and container layers under /var/lib/docker/overlay2, and that is the folder people find filling a disk. A Mac has no such folder; /var/lib/docker doesn’t exist in macOS, and searching Finder for overlay2 finds nothing for the same reason. Docker Desktop runs the engine in a Linux virtual machine and stores its containers and images in a single disk image file, Docker.raw, in your user Library.
Current Docker Desktop may not use overlay2 at all. The containerd image store is the default in Docker Desktop 4.34 and later, switchable in Settings → General, and Docker’s documentation describes overlay2 as a legacy driver superseded by the overlayfs containerd snapshotter. docker info shows which one your setup uses: look at the Storage Driver line, or print the driver status, which reads io.containerd.snapshotter.v1 for the containerd store.
docker info
docker info -f "{{ .DriverStatus }}"Why deleting layer folders breaks Docker
Docker’s storage documentation says plainly not to manipulate files or directories under /var/lib/docker, because Docker manages them. Layers are shared: one base layer can sit under dozens of images and containers, and Docker’s metadata refers to each directory by an ID. Remove a directory and Docker still believes the layer exists, so images fail to run, containers fail to start, and later cleanup commands trip over layers that are missing.
On a Mac, reaching those directories means getting inside the virtual machine, and there is no supported reason to do that for cleanup. Deleting Docker.raw itself is the other shortcut people try. It discards every image, container and volume at once, so treat it as a reset, not a cleanup.
Common questions
Why does Docker.raw show as hundreds of gigabytes when my Mac isn't that full?
Docker.raw is a sparse file that claims its full maximum size, but disk blocks are only allocated as Docker actually writes data. Tools like ls show the maximum, while du shows what's really allocated, which is what it costs your Mac.
Can I delete or move Docker.raw myself in Finder?
No, don't delete or drag it in Finder, since Docker warns it can lose track of the file. Instead, shrink its contents with Docker's own commands, or change its size limit and location through Docker Desktop's settings.
What happens if I lower Docker Desktop's disk size limit?
Docker's FAQ states that reducing the maximum deletes the current disk image, along with all containers and images inside it. Back up any volumes with data you need before changing that setting.
Is Docker.raw included in my Mac's Time Machine backups?
Only if you turned it on. Docker Desktop's General settings have an "Include VM in Time Machine backups" option that is off by default, so unless you enabled it, Time Machine isn't backing up that data.
Where can I find Docker's overlay2 folder on a Mac?
There isn't one to find. Docker Desktop runs its engine inside a Linux virtual machine and stores everything in a single disk image file, Docker.raw, so /var/lib/docker doesn't exist in macOS and a Finder search for overlay2 turns up nothing.
Does current Docker Desktop still use the overlay2 storage driver?
Not necessarily. The containerd image store is the default in Docker Desktop 4.34 and later, and Docker describes overlay2 as a legacy driver it has superseded; docker info shows which driver your setup actually uses.
References & further reading
These guides combine the linked official guidance with ClearDisk’s documented behavior. Your files and app settings determine the right next step.