OpenTofu
Step-by-step guide to install OpenTofu on macOS (Homebrew), Linux (apt, dnf, rpm), and Windows (Chocolatey, Scoop). Includes verification, version pinning...
LLuca Berton2 min read
On this page
- Prerequisites
- macOS — Homebrew
- Linux — Debian / Ubuntu (apt)
- Linux — RHEL / Fedora / Rocky / AlmaLinux (dnf)
- Linux — Manual binary install (any distro)
- Windows — Chocolatey
- Side-by-side with Terraform
- Pinning a specific version with tofuenv
- Verifying the installation
- Next steps
- Conclusion
OpenTofu is the open-source, MPL-2.0-licensed fork of Terraform maintained by
the Linux Foundation. It ships as a single static binary called tofu. This
guide walks through installing it on macOS, Linux, and Windows — including
how to run it side-by-side with the HashiCorp terraform binary.
Prerequisites
- A 64-bit operating system (macOS 12+, modern Linux, Windows 10+).
- Administrator/sudo access to install system packages.
- (Optional) An existing Terraform project to test against — see How to Migrate from Terraform to OpenTofu.
macOS — Homebrew
Homebrew has the official tap maintained by the OpenTofu project.
brew update
brew install opentofu
tofu versionExpected output:
OpenTofu v1.9.0
on darwin_arm64To upgrade later: brew upgrade opentofu.
Linux — Debian / Ubuntu (apt)
Use the standalone installer script published by the project — it handles GPG keys and the apt source automatically:
curl --proto '=https' --tlsv1.2 -fsSL \
https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
chmod +x install-opentofu.sh
./install-opentofu.sh --install-method deb
tofu versionTo upgrade: sudo apt update && sudo apt upgrade tofu.
Linux — RHEL / Fedora / Rocky / AlmaLinux (dnf)
curl --proto '=https' --tlsv1.2 -fsSL \
https://get.opentofu.org/install-opentofu.sh -o install-opentofu.sh
chmod +x install-opentofu.sh
./install-opentofu.sh --install-method rpm
tofu versionLinux — Manual binary install (any distro)
If you prefer not to add a system repository, download the static binary:
TOFU_VERSION=1.9.0
curl -fsSL -o tofu.tar.gz \
"https://github.com/opentofu/opentofu/releases/download/v${TOFU_VERSION}/tofu_${TOFU_VERSION}_linux_amd64.tar.gz"
sudo tar -C /usr/local/bin -xzf tofu.tar.gz tofu
sudo chmod +x /usr/local/bin/tofu
rm tofu.tar.gz
tofu versionWindows — Chocolatey
choco install opentofu
tofu versionOr with Scoop:
scoop bucket add main
scoop install opentofuSide-by-side with Terraform
Because the binary is named tofu (not terraform), you can run both on the
same machine without conflicts. Most projects work unmodified:
# Convert an existing Terraform project to OpenTofu
cd my-terraform-project
tofu init
tofu planState files are interchangeable in both directions for projects that don't use Terraform 1.6+ exclusive features. See Terraform vs OpenTofu in 2026 for the compatibility matrix.
Pinning a specific version with tofuenv
For multi-project work, install tofuenv (a fork of tfenv) to switch
versions on demand:
git clone https://github.com/tofuutils/tofuenv.git ~/.tofuenv
echo 'export PATH="$HOME/.tofuenv/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
tofuenv install 1.9.0
tofuenv use 1.9.0Add a .opentofu-version file in your project to pin per-repository.
Verifying the installation
tofu version
tofu providers
tofu -helpYou should see the same subcommands you know from Terraform: init, plan,
apply, destroy, state, import, workspace, fmt, validate.
Next steps
- How to Migrate from Terraform to OpenTofu
- Terraform vs OpenTofu in 2026
- OpenTofu State Encryption
- Browse the Terraform Glossary for term definitions.
Conclusion
OpenTofu is a drop-in replacement for Terraform that takes minutes to install
and produces a familiar tofu CLI. For most workflows it's a one-line change
in your CI/CD pipelines (terraform → tofu) and a tofu init away from
running.
#OpenTofu#Terraform#Installation#macOS#Linux#Windows
Install Terraform on Debian: Step-by-Step Guide
Install Terraform on Debian 12 Bookworm using the HashiCorp APT repository or manual binary download. Includes verification, autocomplete setup
2 min read
OpenTofu
OpenTofu Provider Registry: Sources, Mirrors, and Caching
How OpenTofu resolves providers from registry.opentofu.org, configures the registry, sets up filesystem mirrors for air-gapped environments, and caches...
3 min read
Install AWS CLI on Windows with winget: Quick Setup Guide
Install AWS CLI v2 on Windows using winget in one command. Configure credentials, set up PowerShell autocomplete, and verify with Terraform.
2 min read
Install Terraform with tfenv: Manage Multiple Terraform Versions
Install and manage multiple Terraform versions with tfenv. Switch between versions per project, auto-detect from .terraform-version files
3 min read

Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.