Table of Contents
The Error
Error: Module not installed. This module is not yet installed.
What Causes This
Terraform cannot find the module in .terraform/modules. This happens after cloning a repo without running terraform init, or after clearing the cache.
How to Fix It
Solution 1: Run terraform init
terraform init
Solution 2: Clear Cache and Reinitialize
rm -rf .terraform .terraform.lock.hcl
terraform init
Solution 3: Check Module Source Path
module "vpc" {
source = "terraform-aws-modules/vpc/aws" # Registry
source = "./modules/vpc" # Local
source = "git::https://github.com/org/modules.git//vpc?ref=v1.0" # Git
}
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.

