How to Set Up Terraform Providers Offline Using Local Mirrors and .terraformrc
Terraform by default downloads providers from the internet during every initialization, which creates bloated project directories and fails in air-gapped or restricted CI/CD environments. A local filesystem mirror, configured via the .terraformrc CLI file, allows Terraform to resolve providers from a local directory instead of the public registry. Developers place the extracted provider binary under a structured path in ~/.terraform.d/plugins-local, matching the provider's source address, version, and platform. Once configured, running terraform init requires no internet access for the mirrored provider, produces no .terraform/providers/ directory in project folders, and ensures deterministic builds across all team members. The setup supports Linux, macOS, and Windows, and remains compatible with standard state backends such as S3 and HTTP.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in