Skip to main content

Terraform vs OpenTofu in 2026: Which Should You Choose?

Key Takeaway

Terraform vs OpenTofu compared for 2026. Licensing (BSL vs MPL), feature differences (Stacks, ephemeral resources), provider compatibility, and which to choose for your team.

Table of Contents

In August 2023, HashiCorp changed Terraform’s license from open-source MPL 2.0 to the Business Source License (BSL 1.1). The community forked Terraform as OpenTofu under the Linux Foundation. In 2026 — with IBM’s acquisition of HashiCorp complete and OpenTofu at version 1.9 — the two projects have diverged enough that the choice matters.

Here’s an honest comparison.

Quick Comparison Table

FeatureTerraform (HashiCorp/IBM)OpenTofu (Linux Foundation)
LicenseBSL 1.1 (not open source)MPL 2.0 (open source)
Latest version (2026)1.10.x1.9.x
Terraform Stacks✅ Yes (GA late 2025)❌ No
Ephemeral resources✅ Yes✅ Yes (independent impl.)
State encryption❌ No (use backend encryption)✅ Native client-side
Provider ecosystemFull registryFull compatibility
Module registryregistry.terraform.ioregistry.opentofu.org + TF registry
HCP Terraform (Cloud)✅ Full integration❌ Not available
Sentinel policies✅ HCP only❌ Use OPA instead
Commercial supportHashiCorp/IBMCommunity + vendors
CLI commandterraformtofu
State file formatCompatibleCompatible

License: The Core Difference

Terraform (BSL 1.1)

You CAN:
✅ Use Terraform for your own infrastructure
✅ Use it in your CI/CD pipelines
✅ Build internal tools on top of it
✅ Contribute to the codebase

You CANNOT:
❌ Build a competing hosted Terraform service
❌ Embed Terraform in a commercial product that competes with HCP

The BSL converts to open-source Apache 2.0 after 4 years. Code from August 2023 becomes Apache 2.0 in August 2027.

OpenTofu (MPL 2.0)

You CAN:
✅ Everything — it's fully open source
✅ Build competing products
✅ Fork, modify, redistribute
✅ Use commercially without restriction

Who Cares About the License?

  • Most teams: The license doesn’t affect you. Using Terraform to manage your infrastructure is explicitly allowed under BSL.
  • Platform teams building IaC-as-a-Service: If you’re building an internal platform that wraps Terraform, check with legal. If it could compete with HCP Terraform, the BSL applies.
  • Vendors/MSPs: If you resell infrastructure management services powered by Terraform, the BSL may restrict you.

Feature Comparison (2026)

Terraform-Only Features

Terraform Stacks (GA late 2025)

Stacks let you deploy multiple Terraform configurations as a single unit with coordinated lifecycle management:

# stack.tfstack.hcl
component "networking" {
  source = "./modules/networking"

  inputs = {
    region = var.region
  }
}

component "compute" {
  source = "./modules/compute"

  inputs = {
    vpc_id     = component.networking.vpc_id
    subnet_ids = component.networking.subnet_ids
  }
}

This is the biggest feature gap between Terraform and OpenTofu in 2026.

HCP Terraform Integration

Remote state, remote runs, Sentinel policies, cost estimation, private registry — all exclusive to HashiCorp’s cloud platform.

OpenTofu-Only Features

Client-Side State Encryption

OpenTofu can encrypt state files before they’re stored in any backend:

# OpenTofu-only feature
terraform {
  encryption {
    method "aes_gcm" "default" {
      keys = key_provider.pbkdf2.default
    }

    state {
      method   = method.aes_gcm.default
      enforced = true
    }
  }
}

With Terraform, you rely on backend-level encryption (S3 SSE, GCS encryption). OpenTofu adds a client-side layer — the state is encrypted before it leaves your machine.

Early Access to Some Features

OpenTofu sometimes ships features faster since it doesn’t gate behind HCP:

  • for_each in provider blocks (shipped earlier in OpenTofu)
  • Provider-defined functions

Both Have

  • Ephemeral resources (independent implementations)
  • import blocks for codeless import
  • moved blocks for refactoring
  • check blocks for assertions
  • Full provider/module ecosystem compatibility

Provider and Module Compatibility

Both use the same provider protocol. In practice:

# This works identically in both
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}
  • AWS provider: ✅ Works in both
  • Azure provider: ✅ Works in both
  • GCP provider: ✅ Works in both
  • All community providers: ✅ Works in both

Module compatibility is also near-100%. The main exceptions are modules that use Terraform Stacks or HCP-specific features.

State File Compatibility

State files are compatible. You can switch between terraform and tofu on the same state:

# Switch from Terraform to OpenTofu
tofu init
tofu plan    # Reads existing Terraform state
tofu apply   # Updates state (now managed by OpenTofu)

# Switch back to Terraform
terraform init
terraform plan  # Reads OpenTofu-written state

Caveat: If you use OpenTofu-only features (state encryption, for_each on providers), the state may not be readable by Terraform.

Migration Guide: Terraform → OpenTofu

# 1. Install OpenTofu
brew install opentofu
# or
curl -fsSL https://get.opentofu.org/install-opentofu.sh | sh

# 2. In your project directory
tofu init       # Downloads providers (uses same registry)
tofu plan       # Should show no changes
tofu apply      # Now managed by OpenTofu

# 3. Update CI/CD
# Replace 'terraform' with 'tofu' in your pipeline

CI/CD Example (GitLab)

# Before
image: hashicorp/terraform:1.10

# After
image: ghcr.io/opentofu/opentofu:1.9
script:
  - tofu init
  - tofu plan
  - tofu apply -auto-approve

When to Choose Terraform

  • You need Terraform Stacks for multi-component orchestration
  • You use HCP Terraform (Cloud) for remote runs, Sentinel, cost estimation
  • You want IBM/HashiCorp commercial support contracts
  • Your organization already standardized on Terraform and switching cost is high
  • You need the absolute latest provider features (some providers test against Terraform first)

When to Choose OpenTofu

  • Open-source license matters to your organization or legal team
  • You need client-side state encryption (regulated industries)
  • You’re a vendor or MSP building products on top of IaC
  • You want to avoid vendor lock-in to IBM/HashiCorp
  • You’re starting a new project with no existing Terraform investment
  • Budget constraints — OpenTofu has no paid tier

When It Doesn’t Matter

For most teams managing AWS/Azure/GCP infrastructure:

  • The CLI syntax is identical
  • The HCL language is identical
  • The providers are identical
  • The state files are compatible
  • The day-to-day workflow is identical

The choice comes down to licensing philosophy, Stacks, and whether you pay for HCP Terraform.

Hands-On Courses

Conclusion

In 2026, Terraform and OpenTofu are both mature, production-ready IaC tools with near-identical daily workflows. Terraform leads with Stacks and HCP integration; OpenTofu leads with open-source licensing and state encryption. Most teams can use either — the decision is about licensing philosophy and whether you need HCP Terraform’s managed features. If you’re already on Terraform and happy, there’s no urgent reason to switch. If licensing matters or you need state encryption, OpenTofu is the clear choice.

🚀

Level Up Your Terraform Skills

Hands-on courses, books, and resources from Luca Berton

Luca Berton
Written by

Luca Berton

DevOps Engineer, AWS Partner, Terraform expert, and author. Creator of Ansible Pilot, Terraform Pilot, and CopyPasteLearn.