Back to blog
DevOps
IntermediateForPlatform EngineersDevOps EngineersBackend Engineers
6 min

OpenTofu vs Terraform in 2026: Is the Fork Worth Switching To?

OpenTofu vs Terraform in 2026: why the fork happened, what actually differs (state encryption, provider for_each, licensing), a comparison table, and an honest verdict on switching.

opentofuterraforminfrastructure-as-codeiacopentofu-vs-terraformdevopshashicorp
Cover image: OpenTofu vs Terraform in 2026: Is the Fork Worth Switching To?
Contents

If you write infrastructure as code, the ground shifted under you in 2023. Terraform — the default IaC tool for a decade — stopped being open source, and the community responded by forking it. That fork is OpenTofu, and by 2026 it is a mature, production-grade tool on version 1.12.

So the real question every platform team is asking: do I stay on Terraform, or switch to OpenTofu? This is an honest, up-to-date answer — why the split happened, what genuinely differs, and when each one is the right call.

Why There Are Suddenly Two Tools

For most of its life, Terraform was licensed under the Mozilla Public License 2.0 (MPL-2.0) — a proper open-source licence. In August 2023, HashiCorp relicensed Terraform (from v1.6 onward) to the Business Source License 1.1 (BUSL) — a source-available licence that restricts competing commercial use. That is not OSI open source.

The community forked the last MPL-2.0 version, and the project — now OpenTofu — moved under the Linux Foundation for vendor-neutral governance. Then IBM announced its acquisition of HashiCorp in 2024 (closed in early 2025), putting Terraform’s stewardship inside a single large vendor. OpenTofu kept going the other direction: open licence, open governance, open registry.

Timeline of the fork: Terraform up to 1.5 was MPL; in August 2023 HashiCorp relicensed to BUSL and the community forked the last MPL version into OpenTofu under the Linux Foundation. Terraform went to HCP Terraform and IBM ownership; OpenTofu added state encryption and reached 1.12.

This matters beyond ideology. A BUSL licence changes what your legal team signs off on, what you can build a product around, and whether the tool’s roadmap is controlled by one vendor or a foundation.

What Is Actually the Same

Here is the part the drama obscures: OpenTofu and Terraform are still the same tool underneath. OpenTofu was a fork, not a rewrite. That means they share:

  • The HCL configuration language — your .tf files work as-is.
  • The provider plugin protocol — the same AWS, Google, Azure, Kubernetes providers run on both.
  • The state model, plan/apply workflow, and terraform {} blocks.
  • Modules, workspaces, moved/import/check blocks, and a native test framework.

Three-column comparison: OpenTofu-only features (state encryption, provider for_each, -exclude, open registry), shared foundation (HCL, providers, plan/apply, modules, testing), and Terraform-only features (HCP Terraform, Stacks, Sentinel, official support).

Because the foundation is shared, migration is mostly a drop-in: install OpenTofu, run tofu init against your existing state, and verify with a small change. The official path is safe and reversible.

What OpenTofu Does That Terraform Doesn’t

The fork didn’t just track Terraform — it added features Terraform still lacks in 2026:

  • Native state & plan encryption. OpenTofu encrypts state and plan files at rest, client-side, with pluggable key providers — AWS KMS, GCP KMS, Azure Key Vault, OpenBao, or a PBKDF2 passphrase — using AES-GCM. If your state file (full of secrets and access keys) leaks, it’s ciphertext. Terraform has no equivalent; you bolt on backend-level encryption instead.
  • Provider iteration with for_each. OpenTofu supports for_each on provider blocks — genuinely useful for multi-region or multi-account setups. It also allows variables in module source and version (dynamic module sources). Terraform still can’t iterate provider configurations.
  • The -exclude flag. Target the inverse of a resource set (tofu plan -exclude=...), the complement to -target.
  • Early variable evaluation for backend and encryption config, and an open, MPL-licensed provider and module registry (registry.opentofu.org) that isn’t bound by the Terraform Registry’s restrictive terms.

A minimal state-encryption block looks like this:

terraform {
encryption {
key_provider "gcp_kms" "prod" {
kms_encryption_key = "projects/acme/locations/global/keyRings/tofu/cryptoKeys/state"
key_length = 32
}
method "aes_gcm" "prod" {
keys = key_provider.gcp_kms.prod
}
state { method = method.aes_gcm.prod }
plan { method = method.aes_gcm.prod }
}
}

What Terraform Still Has Over OpenTofu

This isn’t one-sided. Terraform keeps real advantages, mostly around its commercial ecosystem:

  • HCP Terraform (formerly Terraform Cloud) and Terraform Enterprise — the managed run environment, private registry, and remote state service, tightly integrated.
  • Terraform Stacks — HashiCorp’s higher-level orchestration for managing many configurations together.
  • Sentinel — the policy-as-code engine baked into the HCP ecosystem.
  • Official vendor support and SLAs from IBM/HashiCorp, which some enterprises contractually require.
  • The largest mindshare — tutorials, hiring pool, and third-party integrations still say “Terraform” first.

Side-by-Side: The Full Picture

Side-by-Side: The Full Picture
OpenTofu Terraform
Licence MPL-2.0 (open source) BUSL 1.1 (source-available)
Governance Linux Foundation (vendor-neutral) HashiCorp / IBM (single vendor)
Current version (2026) 1.12 1.x (HashiCorp)
Config language HCL HCL
Providers Same plugin protocol Same plugin protocol
State & plan encryption Native (KMS / PBKDF2, AES-GCM) Not built in
Provider for_each (iteration) Yes No
-exclude targeting Yes No
Registry Open MPL registry HashiCorp registry (restrictive ToS)
Managed platform Third-party (Spacelift, env0, Scalr) HCP Terraform (first-party)
Policy engine OPA / third-party Sentinel (first-party) + OPA
Stacks / orchestration Via CI platforms Terraform Stacks (first-party)
Official vendor SLA No (community + vendors) Yes (IBM/HashiCorp)
Migration Drop-in from Terraform ≤ 1.5/1.6

How to Choose

Decide on dependencies, not on the licence war.

Migrate to OpenTofu if:

  • You need a genuinely open-source licence — legal, compliance, or you build a product on top of the tool.
  • You want native state encryption without bolting it on.
  • You value vendor-neutral governance and an open roadmap.
  • You use provider for_each, -exclude, or a platform (Spacelift, env0, Scalr, GitLab, Harness) that already backs OpenTofu.

Stay on Terraform if:

  • Your workflow is built on HCP Terraform, Terraform Stacks, or Sentinel.
  • You require official IBM/HashiCorp support and SLAs.
  • Your organisation mandates the incumbent vendor and you have no compliance pressure to move.

Not sure? Migration is low-risk and reversible, so pilot OpenTofu on one non-critical stack. Because the HCL and providers are identical, the switching cost is genuinely low — that’s the whole point of a compatible fork.

The Field Rule

OpenTofu and Terraform are the same tool wearing different licences and governance. The code you write barely changes; what changes is who controls the tool and how open it is. For a pure IaC workflow with no hard dependency on HCP Terraform, OpenTofu in 2026 is the safer open default — MPL-licensed, foundation-governed, and ahead on state encryption. If you live inside HashiCorp’s commercial platform, Terraform still earns its place. Pick on your real constraints, pilot before you commit, and remember the migration door swings both ways.

If you provision GKE with either tool, pair this with GKE Autopilot vs Standard in 2026 for the cluster-mode decision, and Secure-by-Default GKE Reference Architecture for hardening what your IaC deploys.

Frequently asked questions

What is OpenTofu and how is it different from Terraform?

OpenTofu is an open-source infrastructure-as-code tool that was forked from Terraform in 2023 after HashiCorp changed Terraform's licence from the open MPL-2.0 to the source-available Business Source License (BUSL 1.1). OpenTofu is governed by the Linux Foundation, stays MPL-2.0, and keeps full compatibility with Terraform's HCL language and provider ecosystem. Functionally it is very close to Terraform, with a few OpenTofu-only features such as native state encryption, provider for_each, and the -exclude flag.

Is OpenTofu a drop-in replacement for Terraform?

For most configurations, yes. OpenTofu reads the same HCL, the same terraform {} blocks, and the same providers through the standard plugin protocol, and its migration path is designed to be safe and reversible — you install OpenTofu, run tofu init against your existing state, and verify with a small change. Divergence is growing as each project adds its own features, so very new Terraform-specific features (HCP Stacks, some 1.7+ additions) may not map, but core IaC code migrates cleanly.

What can OpenTofu do that Terraform cannot?

The headline OpenTofu-only feature is native state and plan encryption at rest, with pluggable key providers (AWS KMS, GCP KMS, Azure Key Vault, OpenBao, or a PBKDF2 passphrase) and AES-GCM. OpenTofu also supports for_each on provider blocks for provider iteration, the -exclude flag to target the inverse of a resource set, early variable evaluation, and an open MPL-licensed provider and module registry. Terraform does not offer state encryption or provider for_each as of 2026.

Should I stay on Terraform or migrate to OpenTofu?

Choose by dependency, not by hype. Stay on Terraform if your workflow is built on HCP Terraform (Terraform Cloud/Enterprise), Terraform Stacks, the Sentinel policy engine, or you need official IBM/HashiCorp enterprise support and SLAs. Migrate to OpenTofu if you need a genuinely open-source (OSI-style) licence for legal or compliance reasons, want native state encryption, prefer vendor-neutral governance, or use a platform (Spacelift, env0, Scalr, GitLab) that already supports it. Migration is low-risk, so many teams pilot OpenTofu on a non-critical stack first.

Is OpenTofu production-ready and who backs it?

Yes. OpenTofu reached general availability in 2024 and is on version 1.12 in 2026, used in production across many organisations. It is a Linux Foundation project with backing and engineering contributions from companies including Spacelift, env0, Scalr, Gruntwork, and Harness, plus a large community. Being vendor-neutral, its roadmap is set in the open rather than by a single company.

From the community

Discussion on the Fediverse

Replies from Mastodon and Bluesky — straight from the open web, no tracking.

Loading replies …

ENDE