OpenTofu is a drop-in, MPL-2.0 licensed fork of Terraform under the Linux Foundation. It speaks the same HCL and provider ecosystem, with community governance and features like state encryption.
Why teams use it
- Open governance and a permissive license
- Drop-in compatibility with existing Terraform code
- Extra features like native state encryption
Install it
brew install opentofu
tofu version
tofu initA first working config
Identical HCL to Terraform - just run with tofu.
terraform {
required_providers { aws = { source = "hashicorp/aws" } }
encryption { # OpenTofu native state encryption
key_provider "pbkdf2" "k" { passphrase = var.state_pass }
method "aes_gcm" "m" { keys = key_provider.pbkdf2.k }
state { method = method.aes_gcm.m }
}
}Run and verify
tofu init
tofu plan -out tfplan
tofu apply tfplanMistakes to avoid early
- Mixing tofu and terraform state operations in one project
- Assuming 100% provider parity for the newest Terraform-only features
- Local state - use remote, locked backends
Want senior help putting OpenTofu to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.