← All insightsGetting Started

Getting started with OpenTofu

CodeWizard Engineering · 14 December 2025 · 3 min read · Beginner

OpenTofu is a drop-in, MPL-2.0 licensed fork of Terraform under the Linux Foundation. It speaks the same HCL and provider ecosystem, with community governance and features like state encryption.

Why teams use it

  • Open governance and a permissive license
  • Drop-in compatibility with existing Terraform code
  • Extra features like native state encryption

Install it

bash
brew install opentofu
tofu version
tofu init

A first working config

Identical HCL to Terraform - just run with tofu.

hcl
terraform {
  required_providers { aws = { source = "hashicorp/aws" } }
  encryption {          # OpenTofu native state encryption
    key_provider "pbkdf2" "k" { passphrase = var.state_pass }
    method "aes_gcm" "m" { keys = key_provider.pbkdf2.k }
    state { method = method.aes_gcm.m }
  }
}

Run and verify

bash
tofu init
tofu plan -out tfplan
tofu apply tfplan

Mistakes to avoid early

  • Mixing tofu and terraform state operations in one project
  • Assuming 100% provider parity for the newest Terraform-only features
  • Local state - use remote, locked backends

Want senior help putting OpenTofu to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.

Like where this is going?

Get hands-on help from the engineers who write these posts.

Book a free consult