- macOS — Homebrew (recommended)
- Manual install — download a specific Terraform binary
- Linux — Debian/Ubuntu (apt)
- Linux — RHEL/CentOS/Amazon Linux (yum/dnf)
- Automation-friendly installs using
releases.hashicorp.com
If you are preparing for the HashiCorp Certified: Terraform Associate 004 exam, practice with Terraform 1.2 since the exam content focuses on that version. You do not always need the latest version for learning or exam prep.
| Method | Best for | Notes / Link |
|---|---|---|
| Homebrew (macOS) | macOS users who want a packaged install | Uses HashiCorp Homebrew tap |
| Manual (ZIP) | Pinning an exact Terraform version | Use releases.hashicorp.com or HashiCorp downloads page |
| apt (Debian/Ubuntu) | APT-based Linux distributions | Adds HashiCorp apt repository and GPG key |
| yum/dnf (RHEL/CentOS/Amazon Linux) | RPM-based Linux distributions | Add HashiCorp RPM repo and install with yum or dnf |
| Automated scripts / CI | Non-interactive installs | Download specific zip from releases.hashicorp.com and install binary |
1) macOS — Homebrew (recommended)
If you use macOS and have Homebrew installed, use the HashiCorp Homebrew tap for the simplest install:
- Homebrew installs to
/opt/homebrew/binon Apple Silicon and to/usr/local/binon Intel macOS. Ensure the Homebrewbinpath is in yourPATH.
2) Download a specific Terraform version (manual install)
To pin a precise release (recommended for predictable exam/CI environments), download the platform-specific ZIP for the release you need from:- HashiCorp downloads page: https://developer.hashicorp.com/terraform/downloads
- Releases mirror: https://releases.hashicorp.com/terraform
terraform executable):
- Unzip the archive.
- Move the
terraformbinary into a directory that appears in yourPATH(example:/usr/local/binor/opt/homebrew/bin). - Make it executable (
chmod +xif necessary). - Verify the installation.
darwin_amd64, darwin_arm64, linux_amd64, linux_arm64, etc.

If
terraform is not found after copying the binary, confirm the target directory is in your PATH (echo $PATH) and that the binary is executable (chmod +x terraform). Use which terraform to locate the active binary. When in doubt, remove older copies or adjust your PATH to prioritize the intended installation.3) Linux — Debian / Ubuntu (apt)
HashiCorp maintains an apt repository for Debian/Ubuntu. To add the GPG key, register the repository, and install Terraform:4) Linux — RHEL / CentOS / Amazon Linux (yum / dnf)
For RPM-based distributions, enable the HashiCorp RPM repository and install viayum or dnf:
dnf, replace yum with dnf. This approach installs the latest package available in HashiCorp’s RPM repository.
5) Using releases.hashicorp.com for automation
For scripted installs in CI/CD or automated provisioning, prefer the releases listing to fetch exact ZIP URLs directly (no interactive UI). Example release listing for a version like 1.2.2:- Download the chosen ZIP from
https://releases.hashicorp.com/terraform/<version>/terraform_<version>_<platform>.zip - Unzip, move binary into a
PATHdirectory, and set executable permissions.
Quick troubleshooting
command not foundafter copying the binary:- Confirm the install directory is in your
PATH(echo $PATH). - Confirm the binary is executable:
chmod +x /path/to/terraform.
- Confirm the install directory is in your
- Multiple Terraform versions:
which terraformshows which binary will be executed. Remove or reorder binaries to control which version is active.
- Permission errors:
- Use
sudowhen moving or writing to systembindirectories, or install to a user-writable directory and add it to yourPATH.
- Use
- HashiCorp Terraform downloads: https://developer.hashicorp.com/terraform/downloads
- Releases mirror: https://releases.hashicorp.com/terraform
- Terraform documentation: https://developer.hashicorp.com/terraform/docs