Skip to main content
Terraform vs OpenTofu: Which to Choose After the License Change

Terraform vs OpenTofu: Which to Choose After the License Change

KU
· Founder & Chief Editor
• 7 min read•Updated •

HashiCorp relicensed Terraform and a community fork spun up overnight. Here's how OpenTofu actually differs and which one your team should run.

Key takeaways

  • Start new projects on OpenTofu unless you depend on HCP Terraform.
  • OpenTofu is the MPL 2.0, Linux Foundation fork of Terraform 1.5, reads the same HCL and state, and adds native state encryption.
  • Terraform 1.6 and later is under the Business Source License, which mainly restricts vendors building competing hosted products.

Choose OpenTofu for new projects and for self-managed state, and stay on Terraform if you rely on HCP Terraform features such as Stacks. OpenTofu is an MPL 2.0 fork of Terraform 1.5 under the Linux Foundation. It runs the same HCL, providers and state, and adds client-side state encryption. Migrating is usually one tofu init and an empty plan.

Verified against

Terraform 1.17.1 (released 2026-10-28), OpenTofu 1.13.2 (released 2026-10-21), against the Terraform LICENSE file, the opentofu.org migration guide and state encryption docs, and the OpenTofu release notes. Checked October 2026.

Why the fork happened

In August 2023 HashiCorp moved Terraform from the Mozilla Public License to the Business Source License (BSL). The current LICENSE file says the BSL covers "Terraform Version 1.6.0 or later," and since a March 2026 update it names IBM as licensor. Its Additional Use Grant allows production use as long as you are not "offering the Licensed Work to third parties on a hosted or embedded basis in order to compete with IBM Corp.'s paid version(s)."

So running terraform apply against your own AWS account was never restricted. The friction was for companies whose product is Terraform automation: Spacelift, env0, Scalr and similar platforms. Several of them backed a fork of the last MPL code, now OpenTofu, and handed governance to the Linux Foundation so no single vendor controls it.

What differs, in one table

DimensionTerraform 1.17OpenTofu 1.13
LicenseBSL 1.1 (IBM licensor)MPL 2.0
GovernanceIBM / HashiCorpLinux Foundation, community
State encryptionBackend-side only (for example S3 SSE)Native client-side, state and plan
Registryregistry.terraform.ioregistry.opentofu.org
Managed platformHCP Terraform, StacksThird-party (Spacelift, env0, Scalr)
Unique featuresStacks, HCP policy toolingProvider for_each, -exclude, early variable evaluation, .tofu files

The CLI is tofu instead of terraform. It reads the same .tf files and speaks the same provider protocol, so the AWS, Google, Azure, Kubernetes and Helm providers work unchanged.

The migration, step by step

This follows OpenTofu's own migration guide. Back up first: copy local terraform.tfstate, or confirm S3 bucket versioning or a snapshot for remote state, and commit everything.

Terminal
brew install opentofu
tofu --version
OpenTofu v1.13.2
tofu init
tofu plan
...
No changes. Your infrastructure matches the configuration.

An empty plan is the signal. If tofu plan shows unexpected changes, do not apply; investigate or roll back. When it is clean:

Terminal
tofu apply
tofu state list | head

The guide recommends that apply even with zero changes because it "ensures OpenTofu updates the state file format if needed." Then make one small, safe change (a tag on a non-critical resource) and run plan and apply again. In CI the switch is usually one line: the binary name in your GitHub Actions, Atlantis or Spacelift config.

If you use terraform_remote_state across several configurations, migrate them in dependency order; the docs have a separate guide for interdependent configurations. Your .terraform.lock.hcl matters here too, since it pins provider checksums; we covered why in the Terraform lock file supply-chain attack.

Rolling back per the guide: stop running tofu, restore state from backup if anything was written, then terraform init and terraform plan and confirm no changes. Reversal is cheap only if you kept the backup and have not adopted OpenTofu-only features.

Native state encryption

This is the feature most teams switch for. OpenTofu 1.7 added client-side encryption of state and plan files, so secrets in state are ciphertext before they reach the backend. Key providers include PBKDF2, AWS KMS, GCP KMS, Azure Key Vault, OpenBao and an external command. To encrypt existing plaintext state, add an unencrypted fallback for one apply:

encryption.tf
terraform {
  encryption {
    key_provider "aws_kms" "primary" {
      kms_key_id = "arn:aws:kms:us-east-1:111122223333:key/abc-123"
      region     = "us-east-1"
      key_spec   = "AES_256"
    }
    method "aes_gcm" "default" {
      keys = key_provider.aws_kms.primary
    }
    method "unencrypted" "migrate" {}

    state {
      method = method.aes_gcm.default
      fallback {
        method = method.unencrypted.migrate
      }
    }
    plan {
      method = method.aes_gcm.default
    }
  }
}

Run tofu apply, then delete the fallback block and set enforced = true inside state so plaintext is refused from then on. The same configuration can live in the TF_ENCRYPTION environment variable, which overrides code settings. Once state is encrypted, Terraform can no longer read it; this is the point of no easy return.

Errors you will hit

ErrorCauseFix
Error: Failed to query available provider packagesProvider missing from registry.opentofu.org, or a typo in sourceCheck the registry; pin a published version
doesn't match any of the checksums previously recorded in the dependency lock fileLock file hashes from another platform or registrytofu providers lock -platform=linux_amd64 -platform=darwin_arm64
Error acquiring the state lockA Terraform run and a tofu run against one backendFinish or kill the other run; never run both binaries in parallel
Plan shows changes right after switchingA Terraform-only feature or function from after the forkCheck that feature's support in OpenTofu before applying

Ecosystem and tooling

Tooling is at parity because the language is the same: Checkov, Trivy, Infracost, terraform-docs and tflint all read OpenTofu configs, and pre-commit hooks need a one-word swap. Provider argument docs are still easiest to read on the Terraform registry, since schemas match. For a different trade-off entirely, see Terraform vs Pulumi, Crossplane vs Terraform, and the wider best Infrastructure-as-Code tools roundup.

Where this breaks

OpenTofu is the wrong move if your workflow runs on HCP Terraform: Stacks, Sentinel policies and the managed run environment are proprietary and will not follow you. It is also risky when you rely on a Terraform feature added after the fork; OpenTofu's migration guide does not publish a per-version compatibility matrix, so test the specific feature. And if procurement already pays IBM for support, the license argument may not outweigh that contract.

Questions people ask

Is OpenTofu a drop-in replacement for Terraform?

For most configurations, yes. OpenTofu reads the same HCL, uses the same providers, and works with existing state, so tofu init followed by tofu plan should report "No changes." The exceptions are HCP Terraform features and any Terraform functionality added after the 2023 fork. Back up state first, because the first tofu apply may upgrade the state file format.

Can I still use Terraform for free?

Yes. The BSL allows production use, including for commercial companies managing their own infrastructure. The restriction in the Additional Use Grant covers offering Terraform to third parties as a hosted or embedded product that competes with IBM's paid versions. Internal teams running terraform apply on their own accounts are not affected.

Does Terraform have state encryption like OpenTofu?

Not client-side. Terraform relies on the backend to encrypt data at rest, such as S3 server-side encryption or HCP Terraform's storage, so the state file itself is plaintext JSON to anyone who can read the bucket. OpenTofu, since 1.7, encrypts state and plan files before they leave your machine using keys from KMS, OpenBao or a passphrase.

The call we'd make

For a new project with no HCP Terraform dependency, start on OpenTofu: the license is cleaner, governance is harder to pull out from under you, and native state encryption fixes a real security gap. For an existing Terraform shop not using commercial HashiCorp features, plan the switch as a one-sprint task: back up state, swap the binary in CI, confirm the empty plan, apply. Teams genuinely using Stacks or HCP policy tooling should stay put.

Sources

Explore topics:TerraformDevOps
React
Share this post
Cite this article
Plain text

Kiril Urbonas (2026). Terraform vs OpenTofu: Which to Choose After the License Change. DevOpsNess. Updated 2026-11-22. https://www.devopsness.com/blog/terraform-vs-opentofu

Markdown

[Terraform vs OpenTofu: Which to Choose After the License Change](https://www.devopsness.com/blog/terraform-vs-opentofu) (Kiril Urbonas, DevOpsNess, updated 2026-11-22)

KU

Kiril Urbonas

Founder & Chief Editor

611 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.