Tools that run virtual machines and clusters download big images once and keep them forever. A Vagrant box is 0.5 to 2 GB and vagrant box update adds the new version next to the old one. minikube keeps its ISO and preloaded images. Every Terraform project keeps its own copy of each provider, and the AWS provider alone is several hundred MB. Add a Lima or Multipass VM you made for one experiment, and it is easy to lose 30 GB without noticing.
Each tool has its own command to remove what it made, and that is the safest way, because the tool also fixes its own records. This guide goes through them. Where a tool has no command, it names the folder.
Measure first (paths that do not exist are skipped):
du -sh ~/.vagrant.d ~/.minikube ~/.lima ~/.colima ~/.terraform.d ~/VirtualBox\ VMs 2>/dev/null
# Mac
du -sh ~/Library/Caches/helm ~/Library/Caches/lima 2>/dev/null
# Ubuntu
du -sh ~/.cache/helm ~/.cache/lima 2>/dev/null
Vagrant: old boxes and machines
Boxes live in ~/.vagrant.d/boxes/<name>/<version>/<provider> (the VAGRANT_HOME variable moves ~/.vagrant.d). Every version of every box stays until you remove it.
vagrant box list
vagrant box outdated --global # which boxes have a newer version
vagrant box prune --dry-run # old versions it would remove
vagrant box prune # remove old versions, keep the newest of each box
vagrant box remove ubuntu/jammy64 --box-version 20240101.0.0
vagrant box prune asks before it removes a box version that a machine still uses (--keep-active-boxes keeps those, --force skips the questions); --dry-run only lists. A removed box is downloaded again by vagrant up or vagrant box add, so a mistake costs a download.
The machines themselves are a different story. A machine’s disk lives with its provider, for example ~/VirtualBox VMs for VirtualBox, and is only freed by vagrant destroy in the project folder. vagrant global-status --prune lists every machine Vagrant knows and forgets the ones whose folder is gone; for a machine whose project folder you deleted, remove its VM in VirtualBox itself. vagrant destroy deletes the VM and everything inside it, so use it only on machines whose data you do not need.
minikube: download cache and clusters
minikube keeps downloads in ~/.minikube/cache: the ISO, the preloaded image tarballs for each Kubernetes version, the base image for the Docker driver and a kubectl per version. A few Kubernetes upgrades make it several GB.
minikube profile list
minikube image ls # images inside the running cluster
du -sh ~/.minikube/cache/*
rm -r ~/.minikube/cache # downloads only; the next start fetches what it needs
minikube delete # delete the default cluster
minikube delete --all # delete every cluster
Deleting ~/.minikube/cache leaves your clusters, profiles and certificates alone. minikube delete --purge also removes the whole ~/.minikube folder, including the certificates, so do not run it unless you want a clean start. With the Docker driver the cluster is a container, so Docker’s own disk use matters too.
Lima and Colima: VM disks and downloaded images
Lima and Colima run a Linux VM for containers. The VM’s disk is a sparse file that only grows.
- Lima: instances in
~/.lima/<name>, downloaded images in~/Library/Caches/lima(Mac) or~/.cache/lima(Ubuntu). - Colima: profiles in
~/.colima/<profile>, with the VM under~/.colima/_lima.
limactl list
limactl delete old-instance # the instance and its disk
limactl prune # downloaded images no instance needs
colima list
colima delete # the default profile and its VM disk
colima prune # downloaded assets
limactl delete and colima delete remove the VM disk, and with it everything inside: for Colima that includes the Docker images and volumes. Export or push what you need first. The VM’s disk file does not shrink when you delete images inside it, so for a bloated VM the fix is colima delete and a fresh start.
Multipass: instances and images (mostly Ubuntu)
Multipass (from Canonical) runs Ubuntu VMs on Mac and Ubuntu. A deleted instance stays on disk until you purge it.
multipass list
multipass info --all | grep -E "Name|Disk usage"
multipass delete old-vm # marks it deleted, recoverable
multipass recover old-vm # change your mind
multipass purge # removes deleted instances for good
multipass delete --purge old-vm # both steps at once
The daemon runs as root, so its data is outside your home: /var/snap/multipass/common/data/multipassd on Ubuntu and /var/root/Library/Application Support/multipassd on a Mac. Look with sudo du -sh, and remove through multipass, not by hand.
Terraform and OpenTofu: provider copies and the plugin cache
terraform init downloads each provider into the project’s .terraform/providers, and modules into .terraform/modules. Twenty projects with the AWS provider are twenty copies. Projects you have not touched in months still hold them.
find ~ -type d -name .terraform -prune -exec du -sh {} + 2>/dev/null | sort -h | tail -20
rm -r ~/projects/old-infra/.terraform/providers # one idle project
Delete .terraform/providers and .terraform/modules only. terraform init brings both back and checks the providers against .terraform.lock.hcl, which you keep. Never delete terraform.tfstate or terraform.tfstate.backup: they record what exists in your cloud, and without them Terraform can no longer manage it. A project that stores state remotely (S3, Terraform Cloud) is fine, but check before you delete.
To stop the copies piling up, tell Terraform to share one. Set plugin_cache_dir = "$HOME/.terraform.d/plugin-cache" in ~/.terraformrc (or export TF_PLUGIN_CACHE_DIR) and create the folder. Terraform never prunes that folder, so over time it collects every provider version you ever used: delete its contents (the registry host folders such as registry.terraform.io) when it gets large, and the next terraform init downloads what it needs.
Helm: the chart and repository cache
helm env HELM_CACHE_HOME prints the cache folder: ~/Library/Caches/helm on a Mac and ~/.cache/helm on Ubuntu. It holds the downloaded repository index files (repository) and chart packages.
helm env HELM_CACHE_HOME
du -sh "$(helm env HELM_CACHE_HOME)"/*
rm -r "$(helm env HELM_CACHE_HOME)/repository"
helm repo update # rebuilds the indexes
Do not delete the folders from helm env HELM_CONFIG_HOME (your repository list) or HELM_DATA_HOME (installed plugins). Releases installed in a cluster are not affected by any of this.
How CleanMate does it
CleanMate lists the items below in Developer Junk of Smart Scan, with their sizes, on a Mac (all macOS features) and on Ubuntu (all Ubuntu features). On Ubuntu they are in CleanMate 2.2.0, available now; on a Mac they come in CleanMate 1.6 (1.5 does not have them yet). Nothing is removed until you confirm. Each item is skipped while its tool runs.
- Old Vagrant boxes: one row per box version, such as “ubuntu/jammy64 20240101.0.0 (virtualbox)”. The newest version of each box, and every version a Vagrant machine in Vagrant’s own machine list uses, is kept. It reads the files in
~/.vagrant.dand never runsvagrant. If it cannot read the machine list, it lists nothing. Not ticked, and deleted rather than trashed, sincevagrant box adddownloads a box again. - Stale Terraform providers:
.terraform/providersand.terraform/modulesof Terraform and OpenTofu projects untouched for 90 days, one row per project, not ticked and moved to the Trash. On Ubuntu they are part of the stale project build folders. State files,.terraform.lock.hcland your.tffiles are never touched. - Terraform plugin cache, minikube cache and Helm cache: the plugin cache folder (also the one you set with
TF_PLUGIN_CACHE_DIRorplugin_cache_dir, and only its registry host folders), minikube’s~/.minikube/cacheand Helm’s cache. The first two are not ticked; the Helm cache is. minikube clusters, profiles and certificates, and Helm repositories and plugins, are kept.
On Ubuntu, CleanMate 2.7.0 lists GNOME Boxes, virt-manager and VirtualBox machines unused for more than 90 days one by one, not ticked and moved to the Trash whole. It does not touch Lima, Colima or Multipass VMs or their disks, and not the Docker images inside them: those hold your data, so use the commands above or the Docker guide (on Ubuntu, also Podman and Docker permission denied). On a Mac, CleanMate 1.12 lists the VMs of Colima, Lima, Podman machine, minikube and Rancher Desktop one by one, not ticked (leftover Linux VMs on a Mac), and Parallels, VMware Fusion, UTM and VirtualBox machines unused for more than 90 days (desktop virtual machines on a Mac). It also cleans OrbStack’s cache and logs, and never its machines.
If the disk is still full, the next suspects are your editors (JetBrains and VS Code using too much disk space), Android Studio, and the rest of the developer caches (Free up disk space on a Mac as a developer or on Ubuntu). To compare what CleanMate does with other cleaners, see the comparison.
FAQ
Is it safe to delete old Vagrant boxes? Yes. Boxes are downloads, and vagrant up or vagrant box add fetches one again. vagrant box prune keeps the newest version of each box.
Does minikube delete remove the cache? No. It deletes the cluster. The downloaded ISO and images stay in ~/.minikube/cache until you delete that folder or run minikube delete --purge.
Can I delete the .terraform folder? Delete .terraform/providers and .terraform/modules; terraform init restores them. Keep the state files and .terraform.lock.hcl.
Why is my Colima or Lima disk still big after I deleted images? The VM’s disk file does not shrink when you free space inside it. Delete the instance (limactl delete, colima delete) and create a new one if you need the space back.
