TechnologyHow to Install Terraform on macOS with Homebrew
How to install Terraform on Mac in 3 commands with Homebrew. Works on Intel and Apple Silicon. Includes version pinning, tfenv, and troubleshooting.
Technology
Terraform install guide for Linux, macOS, Windows. Use apt, dnf, brew, or download binary. Step-by-step for Ubuntu, Debian, RHEL, Fedora, Arch.
To install Terraform, add HashiCorp's official package repository for your OS, then run apt install terraform, dnf install terraform, or brew install hashicorp/tap/terraform. This page 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.
Terraform is distributed by HashiCorp through official package repositories and as a standalone binary. The fastest path depends on your OS:
# macOS (Homebrew)
brew tap hashicorp/tap && brew install hashicorp/tap/terraform
# Debian / Ubuntu (apt)
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install terraform
# RHEL / Fedora / Rocky / AlmaLinux (dnf)
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
sudo dnf install terraformThen confirm the install:
terraform --versionYou should see Terraform v1.12+ on linux_amd64, darwin_arm64, or your matching platform.
apt upgrade, dnf upgrade, or brew upgrade keeps Terraform current alongside the rest of your system. Best for workstations and CI runners..terraform-version file so everyone runs the exact same version./usr/local/bin. Each guide below shows the exact steps.After installing on any platform, run a quick smoke test:
terraform -help # confirms the binary is on your PATH
terraform version # prints the version and provider infoIf 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.
Choose your operating system or distribution for a complete, tested walkthrough including repository setup, verification, and troubleshooting.
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.
Run terraform --version. It prints the installed version and platform. If you see command not found, the binary is not on your PATH.
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.
Once Terraform is installed, get hands-on:
Learn by doing with interactive courses on CopyPasteLearn:
TechnologyHow to install Terraform on Mac in 3 commands with Homebrew. Works on Intel and Apple Silicon. Includes version pinning, tfenv, and troubleshooting.
TechnologyInstall Terraform on Ubuntu 22.04 and 24.04 LTS using the official HashiCorp apt repository. Covers GPG key setup, version pinning, upgrades, and verification.
The best alternatives to Terraform in 2026: OpenTofu, Pulumi, AWS CDK, CloudFormation, Bicep, Crossplane and Ansible, compared by language, state and license.
TechnologyInstall Terraform on Red Hat Enterprise Linux: add the HashiCorp repository, run yum install terraform (or dnf), verify the version and enable autocomplete.