Rancher Desktop's disk only grows: diffdisk, image pruning, and getting space back to macOS
Rancher Desktop stores containers in a virtual disk that keeps its size after you delete images. How to read its real size and hand the space back.
Rancher Desktop runs containers inside a small Linux virtual machine, and that machine's disk is a single file: ~/Library/Application Support/rancher-desktop/lima/0/diffdisk. Images, containers, volumes and build cache all live inside it. Deleting an image frees space inside the file, but not on your Mac.
Read the real size
The disk is a sparse file. Finder and ls show the size it is allowed to grow to. du shows what it actually occupies.
cd ~/Library/Application\ Support/rancher-desktop/lima/0
ls -lh diffdisk # the maximum
du -h diffdisk # what it really usesStep 1: prune inside the machine
Use the client that matches your container engine, chosen in Rancher Desktop's preferences.
# dockerd (moby) engine
docker system df
docker system prune -a # unused images, stopped containers, networks
docker builder prune -a # build cache
# containerd engine
nerdctl system prune -aAdd --volumes only when you are sure no volume holds data you need, such as a local database.
Step 2: hand the freed space back to macOS
After pruning, the space is free inside the machine but still allocated in the file. Trimming tells the virtual disk which blocks are unused.
rdctl shell sudo fstrim -av
du -h ~/Library/Application\ Support/rancher-desktop/lima/0/diffdiskStep 3: the logs
A Rancher Desktop issue on GitHub reported a single network log file growing to hundreds of gigabytes. Check the log folders occasionally:
du -sh ~/Library/Logs/rancher-desktop ~/Library/Application\ Support/rancher-desktop/lima/_networks 2>/dev/nullThe reset
Troubleshooting, Factory Reset in Rancher Desktop removes the machine and everything in it. It is the quickest way to the smallest disk, and the most thorough way to lose a local database. Export what you need first.
If you also run Docker Desktop, Colima or OrbStack, each has its own disk. See Docker taking up disk space, Colima and local Kubernetes clusters.
Common questions
Where does Rancher Desktop store its data on a Mac?
In a virtual disk at ~/Library/Application Support/rancher-desktop/lima/0/diffdisk. Images, containers, volumes and build cache are all inside it.
Why does Rancher Desktop not free space after deleting images?
The space is freed inside the virtual disk but stays allocated in the file. Run rdctl shell sudo fstrim -av after pruning to hand it back to macOS.
Why does Finder show diffdisk as larger than it is?
It is a sparse file. Finder shows the maximum size it may grow to. Run du -h on it in Terminal to see the space it actually uses.