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
OpenTofu
Step-by-step guide to install OpenTofu on macOS (Homebrew), Linux (apt, dnf, rpm), and Windows (Chocolatey, Scoop). Includes verification, version pinning...
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.
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.
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.
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 versionIf 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 versionchoco install opentofu
tofu versionOr with Scoop:
scoop bucket add main
scoop install opentofuBecause 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: Key Differences for the compatibility matrix.
tofuenvFor 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.
tofu version
tofu providers
tofu -helpYou should see the same subcommands you know from Terraform: init, plan,
apply, destroy, state, import, workspace, fmt, validate.
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.
Install Terraform on Debian 12 Bookworm using the HashiCorp APT repository or manual binary download. Includes verification, autocomplete setup
How OpenTofu resolves providers from registry.opentofu.org, configures the registry, sets up filesystem mirrors for air-gapped environments, and caches...
Install AWS CLI v2 on Windows using winget in one command. Configure credentials, set up PowerShell autocomplete, and verify with Terraform.
Install Terraform on Amazon Linux 2023 using the HashiCorp repository or manual binary download. Verify installation, configure autocomplete