Install Terraform on Linux, macOS, Windows, or BSD. Quick apt, dnf, and brew commands plus step-by-step guides for Ubuntu, Debian, RHEL, Fedora, Arch, and 50+ platforms.
LLuca Berton••4 min read
This is the hub for installing Terraform on any operating system. Pick your platform from the directory below for a full step-by-step guide, or use the quick commands here to get running in under a minute.
Official package manager (recommended). Using HashiCorp's apt/dnf/brew repositories means apt upgrade, dnf upgrade, or brew upgrade keeps Terraform current alongside the rest of your system. Best for workstations and CI runners.
Version manager (tfenv). Teams that pin Terraform per project should use tfenv with a .terraform-version file so everyone runs the exact same version.
Manual binary. On distros without a HashiCorp repo (Alpine, Void, Gentoo, Slackware, NixOS), download the official zip, verify the checksum, and drop the binary in /usr/local/bin. Each guide below shows the exact steps.
Docker. For ephemeral or sandboxed runs, the Docker image avoids touching the host at all.
After installing on any platform, run a quick smoke test:
terraform -help # confirms the binary is on your PATHterraform version # prints the version and provider info
If terraform: command not found appears, the binary is not on your PATH. Reopen your shell or add the install directory (for example /usr/local/bin) to PATH.
Add HashiCorp's official repository for your distribution, then install with your package manager: apt install terraform on Debian/Ubuntu, or dnf install terraform on RHEL/Fedora/Rocky/AlmaLinux. On distributions without a HashiCorp repo, download the official binary and place it on your PATH. Each platform guide above has the exact commands.
On macOS, Homebrew (brew install hashicorp/tap/terraform) is the quickest. On Linux, the official apt or dnf repository is easiest because upgrades come through your normal system updates.
How do I check that Terraform installed correctly?
Use tfenv to install and switch between versions, or download the exact version's binary from HashiCorp's releases. Package managers install the latest stable release by default.