OpenTofu
Open source fork of Terraform maintained by the Linux Foundation. Compatible with HCL and Terraform providers, created in response to HashiCorp's license change to BSL 1.1.
OpenTofu is a fork of Terraform created in September 2023 when HashiCorp changed Terraform's license from MPL 2.0 (open source) to BSL 1.1 (source-available, with commercial restrictions). The Linux Foundation adopted the project to ensure a truly open source alternative existed.
Why it exists
The timeline
- 2014-2023 — Terraform under MPL 2.0 license (permissive open source)
- August 2023 — HashiCorp switches to BSL 1.1 (prohibits competitive products)
- September 2023 — OpenTF manifesto signed by 100+ companies
- October 2023 — Linux Foundation adopts the project as OpenTofu
- January 2024 — OpenTofu 1.6.0 (first stable release)
What does BSL 1.1 prohibit?
Terraform's BSL 1.1 license allows using, copying, and modifying the code, but prohibits offering a competitive product based on it. This affects:
- Companies offering Terraform-as-a-Service
- IaC platforms integrating Terraform
- Managed services competing with Terraform Cloud
For end users who only use Terraform internally, the practical impact is minimal.
Compatibility
OpenTofu maintains compatibility with the Terraform ecosystem:
# Basic migration
# 1. Install OpenTofu
brew install opentofu
# 2. Replace commands (drop-in replacement)
tofu init # instead of terraform init
tofu plan # instead of terraform plan
tofu apply # instead of terraform apply
# 3. State file is compatible
# No state migration requiredWhat is compatible?
.tffiles in HCL — 100% compatible- Terraform Registry providers — work directly
- Existing modules — no changes
- State files — compatible format
- Backend configurations — S3, GCS, Azure, etc.
What diverges?
OpenTofu has started adding its own features:
- State encryption — native state file encryption (not available in Terraform OSS)
- Early variable/locals evaluation — early evaluation of variables
- Own registry — registry.opentofu.org as an alternative
When to choose OpenTofu
Choose OpenTofu when:
- Open source licensing is a requirement (compliance, corporate policy)
- You build products or services on top of the IaC tool
- You want to contribute to the project's development
- You need native state encryption
- You prefer Linux Foundation governance
Stay with Terraform when:
- You use Terraform Cloud/Enterprise and its exclusive features
- The team is already trained on Terraform and there's no licensing reason to switch
- You need commercial support from HashiCorp
- Stability of the established ecosystem is priority
Direct comparison
| Aspect | Terraform | OpenTofu |
|---|---|---|
| License | BSL 1.1 | MPL 2.0 (open source) |
| Governance | HashiCorp | Linux Foundation |
| CLI | terraform | tofu |
| HCL compatible | Yes | Yes |
| Providers | Terraform Registry | Compatible + own registry |
| State encryption | Enterprise only | Included (free) |
| Commercial support | HashiCorp | Spacelift, env0, Scalr |
| Community | Established | Growing |
Practical example
# main.tf — works the same in Terraform and OpenTofu
terraform {
required_version = ">= 1.6.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
backend "s3" {
bucket = "my-state-bucket"
key = "prod/terraform.tfstate"
region = "us-east-1"
}
}
provider "aws" {
region = "us-east-1"
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.5.0"
name = "production"
cidr = "10.0.0.0/16"
}State encryption (OpenTofu exclusive)
# OpenTofu only
terraform {
encryption {
key_provider "pbkdf2" "main" {
passphrase = var.state_passphrase
}
method "aes_gcm" "main" {
keys = key_provider.pbkdf2.main
}
state {
method = method.aes_gcm.main
}
}
}Ecosystem and adoption
Companies backing OpenTofu:
- Spacelift — IaC platform, main contributor
- env0 — IaC platform
- Scalr — Terraform/OpenTofu management
- Gruntwork — IaC tools (Terragrunt)
- Harness — CI/CD platform
Why it matters
Terraform's license change to BSL was a turning point for the IaC ecosystem. OpenTofu ensures that investment in HCL knowledge and existing modules is not locked behind a restrictive license. For organizations that value open source as a principle, not just a convenience, OpenTofu is the viable alternative.
References
- OpenTofu Documentation — Linux Foundation, 2024. Official documentation.
- OpenTofu Manifesto — OpenTofu, 2023. The original manifesto with signatories.
- HashiCorp BSL FAQ — HashiCorp, 2023. Official explanation of the license change.
- OpenTofu vs Terraform — OpenTofu, 2024. Official migration guide.
- The Future of Terraform Must Be Open — Yevgeniy Brikman, 2023. Perspective from the author of "Terraform: Up & Running."