Planfile

Terraform vs OpenTofu: what changed, what's compatible, and which to use

Updated

OpenTofu is an open-source fork of Terraform, created after HashiCorp moved Terraform to the Business Source License (BUSL 1.1) in August 2023. It is MPL 2.0, run under the Linux Foundation, and uses the same HCL, providers and workflow with a tofu command instead of terraform. The two were identical at the fork and have added different features since; for most configurations, switching is straightforward.

A Terraform plan in Planfile replacing an S3 bucket, with -/+ and forces replacement
A Terraform plan. tofu plan prints the same format for the same configuration.

Why OpenTofu exists: the 2023 licence change

Terraform was open source under the Mozilla Public License 2.0 (MPL 2.0) from its first release. On 10 August 2023 HashiCorp announced that future versions of its products, Terraform included, would use the Business Source License 1.1 (BUSL, also written BSL). Terraform's licence file names the licensed work as Terraform version 1.6.0 or later; 1.5.x and earlier remain MPL 2.0.

A group of companies and community members published the OpenTF manifesto asking HashiCorp to reverse the change, then forked the last MPL code. The fork was renamed OpenTofu in September 2023 and placed under the Linux Foundation. Key dates:

DateEvent
10 Aug 2023HashiCorp announces the move to BUSL 1.1
Sep 2023OpenTF becomes OpenTofu, a Linux Foundation project
10 Jan 2024OpenTofu 1.6.0, the first stable release
Feb 2025IBM completes its acquisition of HashiCorp
23 Apr 2025OpenTofu accepted into the CNCF as a Sandbox project, keeping MPL 2.0

As of November 2026, the latest releases are Terraform 1.17 and OpenTofu 1.13. The version numbers no longer line up feature for feature, so compare release notes rather than numbers.

What the BUSL means if you just use Terraform

For most people, nothing changed in practice. The BUSL's additional use grant in Terraform's licence allows production use, provided your use doesn't include offering Terraform to third parties "on a hosted or embedded basis in order to compete with" the vendor's paid versions. A competitive offering is defined as a product offered to third parties on a paid basis that significantly overlaps with the capabilities of the paid versions.

So using Terraform to manage your own company's infrastructure, in CI or on laptops, is permitted. The restriction targets companies that sell a product built on Terraform that competes with HCP Terraform, which is why vendors of Terraform automation platforms were among OpenTofu's founders. This is a summary, not legal advice: read HashiCorp's licensing FAQ and the licence text, and ask your legal team if you build or resell tooling around Terraform.

Two more points that are often missed. HashiCorp's official providers, such as hashicorp/aws, are still MPL 2.0, and the BUSL text converts each Terraform version to MPL 2.0 four years after that version is published.

Terraform vs OpenTofu side by side

As of November 2026:

TerraformOpenTofu
LicenceBUSL 1.1 (1.6.0 and later)MPL 2.0
GovernanceHashiCorp, an IBM companyLinux Foundation; CNCF Sandbox project
Commandterraformtofu
LanguageHCL (.tf)HCL (.tf, plus .tofu files)
Providers and modulesTerraform RegistryOpenTofu Registry (same provider addresses, e.g. hashicorp/aws)
Hosted serviceHCP Terraform (and Terraform Enterprise)None from the project; third-party platforms support it
State encryptionVia the backend (for example S3 server-side encryption)Built-in client-side encryption (1.7+)
CertificationHashiCorp Terraform Associate (004 tests 1.12)None from HashiCorp

What's compatible

At the fork the two were the same program, so a lot still matches:

Since 2024 each project has added features the other doesn't have in the same form, so compatibility is high for common configurations and lower for code that uses the newest features of either.

Features in OpenTofu

OpenTofu releases have added, among other things:

terraform {
  encryption {
    key_provider "pbkdf2" "main" {
      passphrase = var.passphrase
    }

    method "aes_gcm" "main" {
      keys = key_provider.pbkdf2.main
    }

    state {
      method = method.aes_gcm.main
    }
  }
}

provider "aws" {
  alias    = "by_region"
  for_each = var.aws_regions
  region   = each.key
}

Both blocks are OpenTofu-only syntax that Terraform doesn't support. Note that the encryption block still sits inside terraform { }, which OpenTofu keeps for compatibility.

Features in Terraform

Terraform releases since the fork have added, among other things:

Where a feature appears in both (OpenTofu added ephemeral values in 1.11), the syntax and details can differ, so check the docs of the tool you run. If you rely on HCP Terraform, Terraform is the natural choice; OpenTofu users typically pair it with self-managed CI or a third-party platform.

Migrating from Terraform to OpenTofu (and back)

OpenTofu's migration guide describes four steps: back up state and code, install OpenTofu, initialise and verify, then test with a small change.

# 1. Back up state (for a remote backend, use its versioning or pull a copy)
terraform state pull > backup.tfstate

# 2. Install OpenTofu, then initialise in the same directory
tofu init

# 3. Expect no changes
tofu plan

If tofu plan shows No changes, apply a harmless change (a tag) to confirm the round trip. Check the guide for your Terraform version first: configurations that use Terraform-only features, the cloud block, or terraform_remote_state to read another configuration's state need extra steps. Moving back to Terraform works the same way in reverse, as long as you haven't used OpenTofu-only features such as state encryption (decrypt first) or provider for_each.

Don't run both tools against the same state as a team habit. Pick one per configuration, pin its version, and migrate deliberately.

Which should you learn or use?

New to both? Start with what Terraform is and the Terraform tutorial; everything there applies to OpenTofu with tofu in place of terraform.

Practise the shared workflow

Planfile teaches Terraform on your iPhone, with Labs that simulate the CLI (init, plan, apply, state) against a fake cloud. The concepts carry straight over to OpenTofu, though the Labs use the terraform command. The first two chapters are free.

Questions

Is OpenTofu a drop-in replacement for Terraform?

For most configurations written for Terraform 1.5 and earlier, yes: same HCL, providers and state. Code using features added to either tool since the fork may need changes.

Is Terraform still free to use?

Yes. Under the BUSL you can use Terraform in production for your own infrastructure at no cost. The restriction covers offering it to third parties in a product that competes with HashiCorp's paid versions.

Why did OpenTofu fork from Terraform?

Because HashiCorp moved Terraform from MPL 2.0 to the Business Source License in August 2023. OpenTofu continues the last MPL-licensed code as an open-source project under the Linux Foundation.

Can OpenTofu use Terraform providers?

Yes. Providers use the same plugin protocol, and the OpenTofu Registry serves the common providers under the same addresses, such as hashicorp/aws.

Does the Terraform Associate exam cover OpenTofu?

No. The HashiCorp Terraform Associate (004) tests Terraform 1.12 and HCP Terraform. Most concepts are shared, but study Terraform for the exam.

Terraform vs OpenTofu: which is better?

Neither overall. Terraform has HCP Terraform and Terraform-only features; OpenTofu has an open-source licence and features like client-side state encryption.