Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Guide · OtherFree

OpenTofu Documentation

The official docs for OpenTofu, the open source, community-run fork of Terraform. Covers the HCL language, the tofu CLI, state and backends, a step-by-step migration path from Terraform, and features Terraform does not have, such as client-side state encryption and provider for_each.

GitHub stars

30.3k (opentofu/opentofu)

GitHub · Sept 2026

Latest release

v1.12.6

GitHub · Sept 2026

Licence

MPL-2.0

GitHub · Sept 2026

Format

Guide

Topic

Other

Provider

OpenTofu (Linux Foundation, CNCF)

Time needed

An evening to start, reference after that

Level

Intermediate

Access

Free

What OpenTofu is

OpenTofu is an open source infrastructure as code tool: you describe cloud resources in HCL files, run a plan to see what will change, and apply it. It started in 2023 as a fork of Terraform after HashiCorp moved Terraform from the open source MPL licence to the Business Source License. OpenTofu kept the MPL-2.0 licence, joined the Linux Foundation, and was accepted into the Cloud Native Computing Foundation as a sandbox project in April 2025. You run it with the tofu command, and the subcommands match the ones Terraform users already know: init, plan, apply, destroy, state and so on.

What the docs cover

  • Getting started: installing tofu, a first configuration, and migrating an existing Terraform project.
  • Language: resources, variables, outputs, locals, data sources, expressions, functions, modules, providers and the import, moved and removed blocks.
  • State: backends, locking, workspaces, and state and plan encryption.
  • CLI: every command and flag, plus configuration of the CLI itself.
  • Internals: how the dependency graph is built and how providers are installed.

Providers and modules are discovered through the OpenTofu registry search at search.opentofu.org.

Is it worth learning?

If you are learning infrastructure as code, learning OpenTofu and learning Terraform are mostly the same skill: the language, the plan and apply workflow, state and modules carry over directly, and most Terraform code works without changes. Reading these docs is worth it if your team or your clients prefer an open source licence, if you want features only OpenTofu has, or if you simply want to understand both sides of a choice many infrastructure teams are now making.

Features worth knowing

  • State and plan encryption: an encryption block encrypts state and plan files on the client side, using a passphrase or a cloud key management service, so a leaked state bucket does not leak secrets.
  • Provider for_each: since OpenTofu 1.9 you can create several aliased provider configurations from one block, which makes multi-region and multi-account setups much shorter.
  • Lifecycle improvements: recent releases added options such as destroy = false to stop managing a resource without deleting it.

Prerequisites and time

You need a terminal, basic cloud knowledge (what a VPC, bucket or virtual machine is) and an account with a cloud provider, or a local provider such as Docker or Kubernetes to practise for free. The getting started pages take an evening. Understanding state, modules and a migration from Terraform properly takes a few weekends of hands-on practice.

Free or paid?

OpenTofu and its documentation are free. Several companies sell hosted automation platforms that run OpenTofu, but you do not need any of them to learn or use it.

Common questions

Should I learn Terraform or OpenTofu first? Either. The concepts and most of the syntax are shared, so switching later costs days, not months. Check what the teams you want to join use.

Can I migrate an existing Terraform project? Yes. The migration guide walks through backing up state and code, installing OpenTofu, running tofu init and checking that a plan shows no unexpected changes. It calls out extra care for setups that share data between configurations through terraform_remote_state.

What can I do after it? Write and review infrastructure code, keep state safe and encrypted, build reusable modules, and explain the Terraform and OpenTofu trade-offs to a team.

Best for: DevOps, cloud and platform engineers, and backend developers who manage their own infrastructure.

devopscloudopen sourceaws

Ready to start?

Opens on OpenTofu (Linux Foundation, CNCF) in a new tab.

Open resource
Link broken or out of date?

Report a problem

With "OpenTofu Documentation". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.