OpenTofu

OpenTofu is an open-source infrastructure as code tool forked from Terraform in 2023 after its license change. It keeps the MPL 2.0 license and is governed as a Linux Foundation and CNCF project.

Also known as: Tofu, OpenTF

Related terms in this glossary

How it works

OpenTofu started as a fork of Terraform 1.5, the last version under the MPL 2.0 open-source license, after HashiCorp moved Terraform to the Business Source License in August 2023. The project joined the Linux Foundation in 2023, and the CNCF accepted it as a sandbox project in April 2025.

It works the same way as Terraform. You write HCL configuration, run tofu init, tofu plan and tofu apply, and store state in a backend. It reads the same providers and modules through its own public registry, and most Terraform configurations run unchanged, which makes migration mostly a matter of swapping the binary and testing.

Since the fork, the two tools have added different features. OpenTofu added client-side state and plan encryption, early variable evaluation in places such as backend blocks, provider iteration with for_each, and an exclude flag for targeted runs. Features added to Terraform after the fork may not be present in OpenTofu, so compatibility should be checked for newer configurations.

Why it matters

OpenTofu gives teams an IaC tool under an open-source license with neutral, foundation governance. That matters most to companies that build commercial products on top of IaC, or that have a policy of avoiding source-available licenses. For many internal users, the choice comes down to features, support and ecosystem, not license. See Gepton's Cloud Infrastructure and IaC service.

OpenTofu in depth

Migrating from Terraform to OpenTofu

For most configurations written for Terraform 1.5 or earlier, migration is mechanical. Newer configurations need more care, because the tools have diverged. A safe sequence:

  1. Inventory. List every root module, its Terraform version, backend type and providers. Note any features added to Terraform after the fork.
  2. Back up state. Copy each state file, or snapshot the backend bucket, before changing anything.
  3. Check the migration guide. OpenTofu publishes version-specific guidance on moving from particular Terraform releases.
  4. Swap the binary in one non-production workspace. Run tofu init to fetch providers from the OpenTofu registry, then tofu plan.
  5. Expect a clean plan. A plan that shows no changes means state and configuration agree. Investigate any proposed change before applying.
  6. Update CI, pre-commit hooks and documentation, then repeat environment by environment.

Keep the ability to roll back for a while: until you adopt OpenTofu-only features, such as state encryption, the state remains readable by the tool you came from.

Example: encrypting state for a regulated workload

Example: a fintech team stores state in an object storage bucket. State files contain resource attributes such as database endpoints and sometimes generated passwords, so the team wants them encrypted on the client side, not only by the storage service. After moving to OpenTofu, they add an encryption block to the terraform settings, use a cloud KMS key as the key provider, and enable encryption for both state and plan files. They first run with a fallback configuration so existing unencrypted state can be read, then apply once to write it encrypted. Access to the KMS key is limited to the CI role that runs applies, so reading the bucket alone no longer reveals state contents.

Running OpenTofu in a team

The operational practices are the same as for any IaC tool:

  • Remote state with locking, one state per environment and component, kept small.
  • Plans generated in CI on every pull request and posted for review.
  • Applies run only from CI with a dedicated identity, never from laptops.
  • Policy as code checks on the plan, using tools such as Checkov, Trivy or Conftest with OPA.
  • Scheduled drift detection: a plan run that alerts when real infrastructure no longer matches code.

Orchestration tools such as Atlantis, Terragrunt and several commercial platforms support OpenTofu. Confirm support for the specific versions you run.

Choosing between OpenTofu and Terraform

ConsiderationPoints toward
Open-source license and foundation governance requiredOpenTofu
Client-side state encryption neededOpenTofu
Heavy use of HCP Terraform or features added after the forkTerraform
Building a commercial product on top of IaCReview licenses carefully; often OpenTofu

Common mistakes

Typical errors are mixing terraform and tofu runs against the same state after adopting OpenTofu-only features, skipping the clean-plan check, pinning no provider versions, and forgetting that modules from the public registry should be reviewed and version-pinned like any dependency. OpenTofu is one implementation of infrastructure as code; Gepton runs migrations and IaC setups in cloud infrastructure and IaC.

Questions about OpenTofu

Something else? Send us your question and an engineer replies with next steps.

Can OpenTofu and Terraform share the same modules?

Generally yes for modules written in the common language both tools understand. Problems arise when a module uses a feature only one tool supports. OpenTofu also recognizes files with a .tofu extension, which it prefers over a .tf file of the same name, so module authors can provide OpenTofu-specific code while keeping .tf files for Terraform. Test shared modules with both tools in CI if you need to support both.

Does switching to OpenTofu change how providers work?

Providers are the same plugins, built against the same plugin protocol, so the AWS, Azure, Google Cloud and Kubernetes providers work in both tools. OpenTofu downloads them from its own registry, which mirrors the public providers. Your lock file will record the new source after init. Pin provider versions as before, and run a plan after migration to confirm nothing changes.

Articles that mention OpenTofu

All articles

Jump to

↑↓ to move↵ to open