OpenTofu vs Terraform: Licensing, Compatibility and How to Choose

Why OpenTofu forked from Terraform, licence differences (MPL vs BSL), compatibility, features unique to each, and how to migrate safely.

Published December 4, 2026

In 2023 HashiCorp changed Terraform's licence from the open-source Mozilla Public License to the Business Source License (BSL). In response, a community fork named OpenTofu was created and accepted into the Linux Foundation. Today both tools are actively developed, share the HCL language and much of the provider ecosystem, and teams must decide which to standardise on.

The concept

The licence change matters most for companies building products that compete with HashiCorp's commercial offerings, but many organisations also prefer an open-source, foundation-governed tool for long-term risk reasons. For most end users managing their own infrastructure, the BSL does not restrict day-to-day use.

OpenTofu started as a drop-in replacement for Terraform 1.5/1.6 and has since added its own features, such as client-side state encryption, while Terraform has continued to add features of its own. Most providers work with both, and configurations written for older Terraform versions usually run on OpenTofu unchanged. Over time, the two are diverging in newer features, so pick one per codebase and test upgrades carefully.

Comparison

TerraformOpenTofu
LicenceBSL 1.1 (source-available)MPL 2.0 (open source)
GovernanceHashiCorp (an IBM company)Linux Foundation, community
CLIterraformtofu
LanguageHCLHCL (compatible base)
ProvidersTerraform RegistryOpenTofu Registry (most providers available)
Notable unique featuresHCP Terraform integration, its own new language featuresClient-side state encryption, community-driven features

Feature lists change with releases; check current docs.

Migration path

  1. Inventory Terraform versions and providers in use
  2. Install tofu alongside terraform; run tofu init and plan
  3. Confirm the plan shows no changes
  4. Switch CI to tofu for one stack; monitor
  5. Roll out stack by stack; avoid version-specific features until done
Migrating from Terraform to OpenTofu.

Verifying a switch

verifiedTerraform ≤1.5 codetofu initsame providerstofu planexpect: no changesSwitch CI
A no-op plan is the migration's success signal.

Practical examples

Running OpenTofu on existing code

Commands mirror Terraform.

tofu init
tofu plan        # should report: No changes. Your infrastructure matches the configuration.
tofu apply

Client-side state encryption (OpenTofu)

Encrypt state before it reaches the backend.

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 }
  }
}

Pin the tool version in CI

Avoid surprise upgrades.

- uses: opentofu/setup-opentofu@v1
  with: { tofu_version: 1.8.x }

Common mistakes

  • Mixing terraform and tofu applies on the same state without a plan.
  • Adopting tool-specific new features before deciding which tool to standardise on.
  • Assuming the licence change forbids normal internal use of Terraform.
  • Skipping a no-op plan verification when switching.

Key takeaways

  • OpenTofu is an open-source fork created after Terraform moved to the BSL.
  • Both share HCL and most providers; newer features are diverging.
  • Choose based on licensing needs, governance preference and platform integrations.
  • Migrate stack by stack, verifying no-op plans.

FAQ

Can I switch back later?

Generally yes for configurations that avoid tool-specific features, but state formats and features may diverge over time.

Do Terraform Cloud/HCP workflows work with OpenTofu?

No; use alternatives such as Spacelift, env0, Scalr, Atlantis or plain CI with remote backends.

Is OpenTofu production-ready?

Yes, it has had stable releases since early 2024 and is used in production by many organisations.

More DevOps articles