Terraform is HashiCorp’s Infrastructure as Code tool for provisioning cloud and on-premises resources from plain configuration files. It ships as a single binary, so setup is quick on any machine. This guide shows every supported way to install Terraform on Windows, Linux, and macOS, plus how to manage versions and fix the errors people hit most.
Terraform System Requirements
The CLI is a self-contained Go binary, so the bar to run it stays low. A regular laptop or a small CI runner has plenty of room.
| Requirement | Details |
|---|---|
| Operating system | Linux, macOS, Windows, FreeBSD, OpenBSD, Solaris (amd64 only) |
| Architecture | amd64, arm64, arm, 386 |
| Memory | ~1 GB free is a practical floor; 4 GB+ for large state and provider-heavy plans |
| Disk | ~100 MB for the binary; the plugin cache can reach several GB per project |
| Network | Outbound HTTPS to registry.terraform.io and your provider APIs |
| Runtime | None. Git 2.3+ helps when pulling remote modules |
You also need terminal access and basic comfort with the command line. Wherever a version like 1.1.0 appears below, treat it as a placeholder and grab the latest stable release from the download page.
Install Terraform on Windows (Manual Download)
The direct route is to pull the binary from HashiCorp and add it to your PATH.
Step 1
Open https://developer.hashicorp.com/terraform/install, find the Windows section, and download the package that matches your CPU (usually amd64).
Step 2
Create a folder at C:\terraform, move the zip into it, and extract it. You get a terraform.exe file.
Step 3
Search the Start menu for Environment Variables. Under System Variables, select Path, click Edit, add C:\terraform, then save and reopen your terminal.
Step 4
Confirm it works:
terraform --version
A version number means Terraform is ready on Windows.
Install Terraform on Windows With Chocolatey
Chocolatey is a command-line package manager for Windows, much like apt on Ubuntu. Open PowerShell as Administrator and run the official setup script from community.chocolatey.org/install.ps1. Reopen PowerShell, then run:
choco install terraform
Type Y to confirm, then check the result:
terraform -version
A clean install prints something like:
Terraform v1.8.5 on windows_amd64
Install Terraform on Windows Using winget
Windows 10 and 11 ship with winget, which gives you a one-line option:
winget install -e --id Hashicorp.Terraform
Run terraform version when it finishes. Package managers sometimes trail the newest release by a few days. If you need the latest build the moment it drops, use the manual download instead.
Install Terraform on Linux (Ubuntu)
You have two clean paths on Linux: the official HashiCorp APT repository or a direct zip download. The repository keeps updates tied to your package manager, so most people start there.
Using the APT Repository
Update the system and pull in the helper packages:
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common curl
Add the HashiCorp GPG key:
wget -O- https://apt.releases.hashicorp.com/gpg \ | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
Register the repository:
echo "deb [arch=$(dpkg --print-architecture) \ signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \ https://apt.releases.hashicorp.com \ $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" \ | sudo tee /etc/apt/sources.list.d/hashicorp.list
Then update and install:
sudo apt update sudo apt install terraform
Need to lock to an older build instead of the latest? The same apt syntax for pinning a package version works here. Verify with terraform -version.
Using a Zip Archive
If you would rather skip the repository, download the zip directly. Make sure wget and unzip are present:
sudo apt-get install wget unzip
Grab the binary, swapping in the current version number:
wget https://releases.hashicorp.com/terraform/1.1.0/terraform_1.1.0_linux_amd64.zip
Extract it. New to the flags? This walkthrough on the unzip command in Linux covers the options worth knowing:
unzip terraform_1.1.0_linux_amd64.zip
Move the binary somewhere on your PATH:
sudo mv terraform /usr/local/bin/
Run terraform -version to confirm.
Install Terraform on macOS Manually
Create a directory for the binary:
sudo mkdir -p /opt/terraform cd /opt/terraform
Download the macOS zip from the install page, then unzip it:
sudo curl -O <paste_download_url> sudo unzip <zip_filename>
Edit your shell profile to expose the binary:
sudo vi ~/.bash_profile
Append these lines:
PATH="/opt/terraform:${PATH}"
export PATH
Apply the change with source ~/.bash_profile. If the profile edit does not stick, this guide on adding a directory to PATH explains both the session-only and permanent methods. Finish by running terraform --version.
Install Terraform With Homebrew on macOS and Linux
Homebrew is the fastest way for most macOS users, and it runs on Linux too.
brew tap hashicorp/tap brew install hashicorp/tap/terraform
Check it with terraform version. To pin a release, use:
brew install hashicorp/tap/[email protected] brew link hashicorp/tap/[email protected] --force
Homebrew always pulls from the official HashiCorp tap. If your system throws a curl: command not found error before Homebrew can run, install curl first and try again.
Managing Multiple Terraform Versions
Terraform has no built-in version switcher. The popular fix is tfenv, which behaves like nvm does for Node.js.
tfenv install 1.5.7 tfenv use 1.5.7
Switch to another release whenever you need it:
tfenv install 0.14.11 tfenv use 0.14.11
Windows users can reach for tfswitch or the Chocolatey version flag. You can also keep separate folders per version and point PATH at whichever one you want active.
Common Terraform Installation Errors and Fixes
| Error | Cause | Fix |
|---|---|---|
| command not found | Binary missing from PATH | Move it to /usr/local/bin/ or add its folder to PATH |
| Permission denied | No execute rights | Run chmod +x terraform, or use sudo when moving it |
| Corrupt or wrong binary | Mismatched OS or architecture | Re-download the correct package from the Terraform site |
| Checksum failure on init | Plugin mismatch | Delete the .terraform/ folder and run terraform init again |
For the permission error, mark the file runnable with chmod and the executable bit before moving it into place.
FAQs
Do I have to install Terraform locally?
Yes, for CLI use. Managed platforms such as HCP Terraform can run it remotely, but a local copy still helps during development and testing before you commit changes.
How do I check if Terraform is already installed?
Run terraform version. On Linux or macOS you can also run which terraform; on Windows, use where terraform. A version number confirms it is on your PATH.
Where should I put the Terraform binary?
On Linux and macOS, /usr/local/bin/ is the standard spot. On Windows, any folder added to the system Path variable works, such as C:\terraform.
Is Terraform still open source?
Versions from 1.5 onward use HashiCorp’s BUSL license, which is source-available but not fully open source. Version 1.5.6 was forked into OpenTofu, which stays under a true open-source license.
Can I run more than one Terraform version?
Yes. Terraform has no native switcher, so use tfenv on Linux and macOS or tfswitch on Windows. Both let you install several versions and select one per project.