WindowsmacOSLinux

Where Does Terragrunt Store Its Cache?

Terragrunt runs everything inside .terragrunt-cache folders per unit. What lands there, cleaning up, and the TG_DOWNLOAD_DIR move.

Last updated

Terragrunt never runs Terraform in your source folder. Each run copies config into .terragrunt-cache beside it, downloads modules and providers there, and executes inside. The folder is pure scratch: deleting it loses nothing but time on the next apply.

Runaway disk usage after run --all usually means providers copied per unit instead of shared. Check provider sharing first on older setups; OpenTofu 1.10 shares by default. Set TG_DOWNLOAD_DIR to relocate caches wholesale, and gitignore .terragrunt-cache everywhere so clones stay clean.

Where Terragrunt stores this, by platform

Windows
.terragrunt-cache

Inside each unit's working directory. Wiping it never touches the shared provider cache or CAS store under your user cache dir. Lock files copy back to the source folder automatically.

macOS
.terragrunt-cache

Same per-unit scratch role. List strays across a monorepo before bulk-deleting after big applies. TG_DOWNLOAD_DIR moves every unit's cache in one stroke.

Linux
.terragrunt-cache

Mirrors macOS. CI runners should cache the shared provider dir rather than these folders. Copy opt-out lives in copy_terraform_lock_file = false for exotic module layouts.

Frequently asked questions

How do I clean up Terragrunt cache folders?

Delete .terragrunt-cache directories in your units; they regenerate on next run. For run --all sprawl, find them all first, then remove. If disk stays full, the shared provider cache under your user cache dir is the real hog.

Where does the .terraform.lock.hcl end up with Terragrunt?

Terragrunt copies your committed lock file into the cache temp folder before running, then copies any updated one back to your source directory. Commit that result as usual. Remote modules with their own lock files may need the copy opt-out.

Notice an outdated path? Let us know.