Terraform vs OpenTofu 2026 — Choosing the Right Infrastructure as Code Tool After the Historic Fork

Posted on: 4/22/2026 8:14:05 AM

Terraform OpenTofu Infrastructure as Code DevOps AWS Azure Cloudflare

In August 2023, HashiCorp changed Terraform's license from MPL 2.0 to BSL 1.1 — and the Infrastructure as Code world split in two. OpenTofu emerged as an open-source fork under the Linux Foundation. Two and a half years later, both projects have diverged significantly: Terraform heads toward Agentic Infrastructure with Project Infragraph and MCP servers, while OpenTofu focuses on openness and community-driven features — state encryption, OCI registry, provider for_each. This article provides a deep analysis of both directions to help you choose the right IaC tool for your team in 2026.

1. Background — From One Codebase to Two Paths

To understand why the "Terraform or OpenTofu?" question matters, let's review the timeline:

August 2023
HashiCorp changes Terraform's license from MPL 2.0 to BSL 1.1 (Business Source License). Cloud providers can no longer offer competing managed Terraform services.
September 2023
OpenTofu manifesto published, hundreds of companies sign in support. Terraform v1.5.6 (last MPL version) forked into OpenTofu.
January 2024
OpenTofu 1.6 GA — first drop-in replacement, nearly 100% compatible with Terraform.
December 2024
IBM completes HashiCorp acquisition for $6.4 billion. Terraform officially under IBM ownership.
June 2025
OpenTofu 1.10 released — OCI Registry, native S3 state locking, OpenTelemetry tracing.
September 2025
HashiCorp launches Project Infragraph (private beta) and MCP servers for Terraform, Vault.
April 2026
Terraform Enterprise 2.0 moves to IBM SC2 support model — 6-month release cycle. OpenTofu reaches ~12% adoption, 27% of teams evaluating.
$6.4BIBM acquired HashiCorp (12/2024)
2,000+Providers on OpenTofu Registry
12%OpenTofu adoption rate (4/2026)
43K+GitHub stars — OpenTofu

2. Licensing — The Core Issue

Every technical decision starts with the licensing question. This is the irreconcilable split between the two projects:

CriteriaTerraform (BSL 1.1)OpenTofu (MPL 2.0)
License typeSource-available, not open-source by OSI definitionOSI-compliant open-source, backed by CNCF and Linux Foundation
Internal useUnrestrictedUnrestricted
Hosted serviceProhibited if competing with HCP TerraformFully permitted
Fork / modifyAllowed internally, cannot distribute modified versions as competing serviceFree to fork, modify, redistribute
Legal risk"Competing offering" boundary unclear in some edge casesNo risk — MPL license proven for decades

When does BSL actually affect you?

If you only use Terraform CLI to manage internal infrastructure (whether startup or enterprise), BSL 1.1 has no impact. Issues arise when you: (1) build a managed IaC platform sold to customers, (2) integrate Terraform into a SaaS offering where IaC is part of the product value, or (3) need supply chain compliance requiring all stack components to be OSI-approved. In these cases, OpenTofu is the safer choice.

3. Deep Feature Comparison 2026

After two and a half years of independent development, the projects have notable divergences. Here's a detailed analysis:

3.1. State Management

This is where OpenTofu clearly excels. Since version 1.7 (2024), OpenTofu supports native state encryption — encrypting the state file at rest without third-party tools.

# OpenTofu — State Encryption with AWS KMS
terraform {
  encryption {
    key_provider "aws_kms" "main" {
      kms_key_id = "arn:aws:kms:ap-southeast-1:123456789:key/abcd-1234"
      region     = "ap-southeast-1"
    }

    method "aes_gcm" "encrypt" {
      keys = key_provider.aws_kms.main
    }

    state {
      method = method.aes_gcm.encrypt
    }

    plan {
      method = method.aes_gcm.encrypt
    }
  }
}

Terraform has no equivalent feature in its CLI. To encrypt state, you must rely on backend encryption (S3 server-side encryption, Azure Storage encryption) or use HCP Terraform.

Additionally, OpenTofu 1.10 adds native S3 state locking — no separate DynamoDB table needed for locking, saving costs and simplifying setup:

# OpenTofu 1.10 — S3 native locking (no DynamoDB needed)
terraform {
  backend "s3" {
    bucket       = "my-tofu-state"
    key          = "prod/terraform.tfstate"
    region       = "ap-southeast-1"
    use_lockfile = true  # Native S3 conditional writes
  }
}

# Comparison: Terraform still requires DynamoDB
terraform {
  backend "s3" {
    bucket         = "my-tf-state"
    key            = "prod/terraform.tfstate"
    region         = "ap-southeast-1"
    dynamodb_table = "terraform-locks"  # Must create and manage separately
  }
}

3.2. Provider & Module Registry

OpenTofu 1.10 introduces OCI Registry Support — distributing providers and modules through container registries (Docker Hub, GHCR, AWS ECR). A major step for enterprises needing air-gapped deployments or tighter supply chain control:

# OpenTofu 1.10 — Provider from OCI registry
terraform {
  required_providers {
    aws = {
      source  = "oci://ghcr.io/my-org/providers/aws"
      version = "~> 5.80"
    }
  }
}

3.3. Provider for_each — Simplified Multi-region

One of Terraform's biggest pain points: managing multi-region infrastructure requires declaring each provider alias separately. OpenTofu 1.9 solves this with for_each on provider blocks:

# OpenTofu 1.9+ — Provider for_each
variable "regions" {
  default = ["ap-southeast-1", "us-east-1", "eu-west-1"]
}

provider "aws" "multi" {
  for_each = toset(var.regions)
  region   = each.value
}

resource "aws_s3_bucket" "regional" {
  for_each = toset(var.regions)
  provider = aws.multi[each.value]
  bucket   = "my-app-${each.value}"
}

3.4. Terraform Stacks — Multi-component Deployment Management

Conversely, Terraform has Terraform Stacks (GA since 2025) — a feature OpenTofu doesn't have an equivalent for. Stacks organize multiple Terraform configurations into a single deployment unit, solving orchestration between interdependent components:

# Terraform Stack — tfstack.hcl
component "networking" {
  source = "./modules/networking"
  inputs = {
    vpc_cidr = var.vpc_cidr
  }
}

component "database" {
  source = "./modules/database"
  inputs = {
    subnet_ids = component.networking.private_subnet_ids
  }
}

component "application" {
  source = "./modules/application"
  inputs = {
    db_endpoint = component.database.endpoint
    vpc_id      = component.networking.vpc_id
  }
}

When are Stacks actually useful?

Stacks shine when you have multiple interdependent Terraform workspaces currently orchestrated via Terragrunt, custom scripts, or CI pipelines. For small teams with 1-2 configurations, Stacks add unnecessary complexity. Note: Stacks are only available on HCP Terraform (cloud), not in the open-source CLI.

3.5. Project Infragraph & MCP Servers — AI-driven Infrastructure

This is HashiCorp/IBM's biggest long-term strategy for Terraform. Project Infragraph (private beta 12/2025) is a real-time infrastructure graph connecting resources, applications, services, and ownership metadata. HCP Terraform MCP Server (beta) enables AI agents to interact with infrastructure using natural language — triggering workspace runs, querying resource states, and receiving insights from registries.

OpenTofu 1.10 also has its own MCP server, but it focuses on letting AI agents write and validate HCL code rather than orchestrating an infrastructure graph.

4. Comprehensive Comparison Table

FeatureTerraform 1.10+ (BSL)OpenTofu 1.10 (MPL)
LicenseBSL 1.1 (source-available)MPL 2.0 (OSI open-source)
GovernanceIBM/HashiCorpLinux Foundation / CNCF
State encryptionBackend only or HCPNative (AWS KMS, GCP KMS, PBKDF2, Vault)
S3 state lockingRequires DynamoDB tableNative S3 conditional writes
Provider for_eachNot supportedAvailable (since v1.9)
OCI RegistryNot supportedAvailable (since v1.10)
Terraform StacksGA (HCP only)No equivalent
Project InfragraphPrivate betaNot available
MCP ServersTerraform + Vault + Vault RadarCommunity MCP server
OpenTelemetryNot nativeNative tracing (since v1.10)
Early variable evalNoAvailable (since v1.8)
Cloud platformHCP Terraform (strong free tier)Spacelift, Scalr, env0, Terramate
Enterprise supportIBM SC2 — 6-year lifecycleThird-party vendors

5. Real-world IaC Pipeline Architecture

Whether you choose Terraform or OpenTofu, a production IaC pipeline needs the same core components: lint → plan → review → apply → drift detection. Both tools are interchangeable at the CLI level.

# GitHub Actions — IaC Pipeline (compatible with both Terraform and OpenTofu)
name: Infrastructure Deploy
on:
  pull_request:
    paths: ['infra/**']
  push:
    branches: [main]
    paths: ['infra/**']

permissions:
  id-token: write
  contents: read
  pull-requests: write

jobs:
  plan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: opentofu/setup-opentofu@v1
        with:
          tofu_version: "1.10.1"
      - uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: arn:aws:iam::123456789:role/github-oidc
          aws-region: ap-southeast-1
      - run: tofu init && tofu plan -no-color -out=tfplan
        working-directory: infra/

  apply:
    needs: plan
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    environment: production
    steps:
      - uses: actions/checkout@v4
      - uses: opentofu/setup-opentofu@v1
      - run: tofu init && tofu apply -auto-approve
        working-directory: infra/

6. Multi-Cloud Management: AWS + Azure + Cloudflare

One of IaC's greatest strengths is managing multi-cloud from a single codebase. Both tools use the same HCL syntax and providers for AWS, Azure, and Cloudflare resources.

7. Migration Guide

7.1. Terraform → OpenTofu

For Terraform versions ≤ 1.5.x (pre-BSL), migration is a binary swap:

# Step 1: Backup state
cp terraform.tfstate terraform.tfstate.backup

# Step 2: Install OpenTofu
curl -fsSL https://get.opentofu.org/install-opentofu.sh | sh

# Step 3: Re-init (no code changes needed)
tofu init -upgrade

# Step 4: Verify with plan
tofu plan
# Should show: "No changes. Your infrastructure matches the configuration."

Important note on state compatibility

After running tofu apply with OpenTofu 1.7+, the state file may contain metadata or encryption markers that make it unreadable by Terraform CLI. This is a one-way migration if you enable state encryption. Ensure your team has aligned on the decision before applying.

8. Which Tool? Decision Framework

Practical recommendations for 2026

Startups / Small teams (< 10): Choose OpenTofu. Completely free, built-in state encryption, no license concerns. Combine with GitHub Actions free tier and S3 backend.

Enterprises already on Terraform: No rush to switch. Evaluate whether you need state encryption or provider for_each. If invested in HCP Terraform, the Stacks + Infragraph + MCP ecosystem is a significant advantage.

Teams building Internal Developer Platforms: OpenTofu + Spacelift/Scalr is a powerful, fully open-source friendly combo.

9. Observability for IaC Pipelines

OpenTofu 1.10 includes built-in OpenTelemetry tracing — every tofu plan and tofu apply generates spans that can be sent to a collector. This enables measuring plan duration per module, apply duration per resource, error rates per provider, and state operation latency.

# Enable OpenTelemetry for OpenTofu
export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317

tofu plan   # Traces automatically sent to collector
tofu apply  # Spans for each resource operation

10. Conclusion

The 2023 Terraform/OpenTofu split has produced two products with distinctly different philosophies by 2026:

  • Terraform under IBM heads toward an enterprise platform play — Stacks, Infragraph, MCP servers, FinOps integration. Strength lies in the HCP ecosystem and Agentic Infrastructure vision. Trade-off: BSL license, best features locked to cloud platform.
  • OpenTofu under Linux Foundation pursues community-driven innovation — state encryption, OCI registry, provider for_each, native OpenTelemetry. Strength lies in openness, feature shipping speed, and vendor neutrality. Trade-off: lacks integrated enterprise platform, smaller commercial support ecosystem.

The good news: HCL code remains highly compatible between both tools. You can start with either and migrate when needed — as long as you haven't used exclusive features. Make your decision based on licensing needs, required features, and team platform strategy rather than following trends.

References