Table of Contents
The Error
Error: Failed to query provider registry / registry.terraform.io is not reachable
What Causes This
Terraform can’t connect to registry.terraform.io. Corporate firewalls, VPN routing, DNS failures, or TLS interception.
How to Fix It
Solution 1: Check Connectivity
curl -v https://registry.terraform.io/.well-known/terraform.json
Solution 2: Configure Proxy
export HTTPS_PROXY=http://corporate-proxy:8080
terraform init
Solution 3: Use Provider Mirror
# Whitelist: registry.terraform.io, releases.hashicorp.com
terraform providers mirror /path/to/mirror
Prevention Tips
- Pin provider versions — avoid surprise breaking changes
- Use CI/CD — catch errors before they hit production
- Test with
terraform plan— always review before applying - Keep Terraform updated — newer versions have better error messages
- Use
terraform validate— catches syntax errors early
Hands-On Courses
- Terraform for Beginners on CopyPasteLearn
- Terraform By Example — practical code examples
- Terraform Cheat Sheet — quick reference for all commands
Related Articles
- Terraform Troubleshooting - Common Errors and Solutions
- Terraform Enabling and Using Debugging
- Debugging with TFLint
Conclusion
This error is common and fixable. Follow the solutions above, and check our Terraform course for hands-on training that covers real-world troubleshooting scenarios.

