Terraform vs OpenTofu: License, Features, and Choice
Compare HashiCorp Terraform and OpenTofu across license history (BSL vs MPL), feature divergence, compatibility, and which one to pick.
TL;DR
OpenTofu (MPL 2.0, CNCF) and Terraform (BSL 1.1, HashiCorp/IBM) share the same HCL roots and provider ecosystem, but have diverged since August 2023. Pick OpenTofu for open-source governance, client-side state encryption, and dynamic backend/module variables; pick Terraform if you are already standardized on HCP Terraform or HashiCorp enterprise support.
Context
On August 10, 2023, HashiCorp relicensed Terraform from the open-source MPL 2.0 to the source-available BSL 1.1 (restricting competing hosted offerings). The community forked Terraform 1.5.6 into OpenTofu under the Linux Foundation / CNCF, keeping MPL 2.0 permanently.
Comparison
| Dimension | OpenTofu (v1.13) | Terraform (v1.17) |
|---|---|---|
| License & Governance | MPL 2.0 (CNCF / Linux Foundation) | BSL 1.1 (HashiCorp / IBM) |
| Client-side state encryption | Built-in encryption {} block (KMS, PBKDF2, OpenBao) | Not built-in (relies on backend SSE or HCP Terraform) |
Variables in backend & module.source | Supported via early variable evaluation (1.8+) | Not supported (must use -backend-config or static strings) |
| Provider-defined functions | Supported (provider::name::fn) | Supported (provider::name::fn) |
| Managed platform | Self-hosted, Spacelift, env0, Scalr, GitHub Actions | HCP Terraform (Terraform Cloud) & Enterprise |
| Provider registry | registry.opentofu.org (mirrors public providers) | registry.terraform.io |
Decision criteria
- License & vendor lock-in: If your company policy or product embeds IaC tooling, MPL 2.0 (OpenTofu) avoids BSL 1.1 legal ambiguity.
- State security & DRY backends: OpenTofu's client-side
encryption {}and variables insidebackend {}remove whole classes of wrapper scripts (like Terragrunt boilerplate for backends). - Existing platform investment: If you pay for HCP Terraform private registry, policy sets (Sentinel), and support SLAs, migrating off Terraform brings little upside.
Gotchas
- State format divergence: once you enable OpenTofu-only features (like
encryption {}or new state schema versions), Terraform cannot read that state file without decrypting/migrating first. - Registry URLs:
registry.opentofu.orgmirrors open-source providers, but a few commercial providers may have license terms tied to Terraform. - Mixing binaries: never run
terraform applyandtofu applyinterchangeably on the same state directory in CI.
Production checklist
- Standardize on one binary (
tofuorterraform) per repository and pin it in CI - Pin
required_versionandrequired_providersversions inversions.tf - Commit
.terraform.lock.hcl(works for both) to lock provider checksums - If choosing OpenTofu, enable
encryption {}on remote state
Check yourself
Check Yourself
1. What was the primary reason OpenTofu was forked from Terraform 1.5.6 in 2023?
2. Which feature is available in OpenTofu 1.8+ but forbidden in Terraform?
Sources
Related Notes
IaC Modules: When and How to Extract Them
Structure reusable OpenTofu/Terraform modules with clean inputs, outputs, and semantic versioning—and know when a module is premature abstraction.
OpenTofu Cheatsheet
Everyday tofu CLI commands for init, plan, apply, state inspection, formatting, and unlocking—verified against the OpenTofu 1.13 docs.