Skip to content

How it works

OpenTofu reuses the Terraform language, provider protocol and state format, and adds a parallel registry plus OpenTofu-only features such as native state encryption.

The workflow is the same four commands Terraform users already know: tofu init downloads providers and modules, tofu plan computes a diff, tofu apply commits it, tofu destroy tears it down. The binary reads .tf files, builds a DAG and calls provider plugins over gRPC.

Compatibility has three layers. The configuration language is HCL, unchanged. The provider plugin protocol is the same, so any provider binary that works with Terraform also works with OpenTofu. The state file format is compatible, which makes migration a matter of pointing the binary at the existing backend.

The registry is where the projects diverge. Terraform resolves providers from registry.terraform.io; OpenTofu defaults to registry.opentofu.org, which mirrors most of the Terraform registry, including every HashiCorp-maintained provider, but signs its own releases. OpenTofu refuses providers whose signatures do not match its trust roots.

OpenTofu-only features appear from 1.7 onward. Native client-side state encryption, introduced in 1.7, encrypts state and plan files before they reach the backend. Early evaluation of variables and locals, introduced in 1.8, allows dynamic values in module sources, backend configuration and encryption blocks. The .tofu override extension lets a module carry OpenTofu-specific files alongside Terraform-compatible .tf files.