[Virtual Event] IaCConf 2026: Real stories on how infra teams are keeping pace

Register Now ➡️

Terraform

Download & Install Terraform on Windows, MacOS, Linux

How to download and install Terraform - tutorial

Developed by Hashicorp, Terraform is a powerful Infrastructure as Code (IaC) tool that facilitates infrastructure management and creation on-premises and in the cloud. However, without proper guidance, beginners may find installing Terraform challenging.

In this guide, you’ll learn how to install Terraform on Windows (manual, Chocolatey, winget), Linux (Ubuntu via apt, zip archive), and macOS (manual, Homebrew). We also cover how to install specific versions, manage multiple versions with tfenv, verify your installation, and troubleshoot common errors.

  • Installing Terraform on Windows
  • Installing Terraform on Windows using Chocolatey
  • Installing Terraform on Linux (Ubuntu) using package repository
  • Installing Terraform on Linux using a Zip archive file
  • Installing Terraform on macOS
  • Installing Terraform using Homebrew on macOS or Linux

What are Terraform system requirements?

Terraform CLI ships as a single Go binary, so the bar to run it is low. A modern laptop or even a small CI runner has more than enough headroom.

Requirement Spec
Operating system Linux, macOS, Windows, FreeBSD, OpenBSD, Solaris (amd64 only)
Architecture amd64, arm64, arm, 386
Memory No official minimum, but ~1 GB free is a practical floor; 4 GB+ recommended for large state files and provider-heavy plans
Disk ~100 MB for the binary, plus 100 MB to several GB per project for the .terraform/ plugin cache (the AWS provider alone is ~600 MB unpacked)
Network Outbound HTTPS to registry.terraform.io and your target provider APIs
Runtime dependencies None. Git 2.3+ recommended for pulling remote modules

Prerequisites

Before you start the installation process, there are some prerequisites that you will need to fulfill:

  • A Windows PC if you are installing on Windows
  • A Linux system (virtual or local) if you are installing on Linux (in this post, I am using Ubuntu 20.04 to demonstrate the steps)
  • Some basic CLI knowledge

Note: Where you see a specific version like 1.1.0, treat it as an example — always check the Terraform download page for the latest stable release.

How to install Terraform on Windows

If you are installing Terraform on Windows, download the appropriate Terraform package from the Terraform download page, unpack it, and run it from the command line.

Follow the steps below to make sure you install it correctly:

Step 1: Download the installation file

Navigate to the Terraform download page (https://developer.hashicorp.com/terraform/install). It should list out Terraform downloads for various platforms. 

Navigate to the Windows section and download the respective version. For this example, we are downloading V1.1.0.

terraform windows download

Click on the version that matches your system architecture to download a zip file. 

Step 2. Extract the file

Create a folder on the C drive as C:/terraform. Download the zip file in this folder. Unzip the file to extract the .exe file.

C:/terraform

Step 3. Update the path environment variable

Next, open the Start menu and search for Environment variables. Open the Environment Variables settings page.

Update Path Environment Variable

On the Environment variables edit page, open the Path variable as shown below:

Edit environment variables

On the Path pop-up that opens, click New and add the Terraform download folder. This is the folder where the zip file was downloaded and unzipped (C:/terraform).

add the Terraform download folder

Click OK to save the Path variable addition. If needed, restart your system to apply the variable changes.

Step 4. Verify if the correct version of Terraform is installed

Open a command prompt and run this command to verify Terraform is installed successfully:

verify if Terraform is installed successfully

To verify the installed version, run the terraform --version command just like below:

correct version of Terraform

How to install Terraform on Windows using Chocolatey

Chocolatey is a package manager for Windows that simplifies software installation and management using command-line commands, similar to apt on Debian/Ubuntu or brew on macOS.

First, let’s install Chocolatey. Open PowerShell as Administrator:

  • Click on the Start Menu, search for PowerShell
  • Right-click on Windows PowerShell, select “Run as administrator”

Run this official one-liner from Chocolatey’s website to install Chocolatey:

Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = `
[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))

Close and reopen PowerShell to apply the updated PATH environment variable.

Once Chocolatey is installed, run this command in PowerShell or Command Prompt:

choco install terraform

Confirm the installation by typing Y when prompted. Chocolatey will download the latest verified version of Terraform and place it in your system path.

After installation completes, open a new Command Prompt or PowerShell window (not necessarily as admin), and verify by running:

terraform -version

This should output the installed Terraform version, confirming success. You should see output similar to:

Terraform v1.8.5
on windows_amd64

If this command runs without error, Terraform is correctly installed and globally available in your system’s PATH.

How to install Terraform on Windows using winget

If you’re on Windows 10/11 with the Windows Package Manager (winget) available, you can install Terraform with:

winget install -e --id Hashicorp.Terraform

After it completes, verify:

terraform version

Note: Package managers like winget may lag slightly behind the latest Terraform release. If you absolutely need the newest version on day one, use the manual download method instead.

How to install Terraform on Linux

If you are installing Terraform on Linux, you have two options: The most popular approach is to use the Terraform zip with the executable file, which you can uncompress in any location on your Linux system. Ensure the folder containing the executable file is in the PATH so you can access it from everywhere. Alternatively, you can use the HashiCorp repository.

Installation using package repositories on Linux (Ubuntu)

First, we will show the steps for installing Terraform using the Linux package repository. You can follow these steps for Ubuntu. For other Linux versions, the steps are similar, but will depend on the specific package repositories. 

To start, log in to the system and run the steps below as root for sudo access.

Make sure the system is up-to-date and install these packages, which are needed for further steps:

sudo apt-get update && sudo apt-get install -y gnupg software-properties-common curl

Next, add the Hashicorp GPG key needed by the repository:

wget -O- https://apt.releases.hashicorp.com/gpg \
  | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg

Then, add the official repository for HashiCorp for Linux:

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

Now that we have added the repo to the list, let’s update to add the relevant repository content:

sudo apt update

Once updated, run this command to install Terraform:

sudo apt install terraform

That should complete the installation. 

To verify the installation, run this and verify the output:

verify the installation

To verify the version installed, run: terraform -version

correct version of Terraform

Install Terraform on Linux using a zip archive

Now, we’ll show the method for installing Terraform using the downloaded zip file. 

First, log in to the system and run the commands below as root.  

Before starting the installation process, get the download link from the Terraform website. Then, navigate to the Terraform install page and move to the specific OS version. 

Here we are looking for Linux:

download link for Linux from the Terraform site

Copy the link for the respective download:

Copy the link for the Linux download

Now, log in to the Ubuntu system. Make sure Wget and Unzip are installed. If not, install the same:

sudo apt-get install wget unzip

Download the Terraform zip file by running the following command. Put the URL copied earlier in the command for download. The version number in the example below (1.1.0) is just a placeholder — replace it with the latest version you copied from the Terraform downloads page.

wget
wget https://releases.hashicorp.com/terraform/1.1.0/terraform_1.1.0_linux_amd64.zip

The zip file should download:

The downloaded zip file

Unzip the zip file in the current folder. Again, update the zip file name if you downloaded a different version:

unzip terraform_1.1.0_linux_amd64.zip
unzip terraform_1.1.0_linux_amd64.zip

The Terraform executable should get unzipped in the current folder:

terraform executable

Move the Terraform executable file to the /usr/local/bin folder so it’s available system-wide:

sudo mv terraform /usr/local/bin/

That should complete the Terraform installation. Verify the installation by verifying the version:

Verify the installation on Linux

How to install Terraform on macOS

To install Terraform on macOS, download the Terraform binary zip from Hashicorp, unzip it, and copy the binary to a place in the path.

Log in to the system and create a folder for the Terraform executable:

sudo mkdir -p /opt/terraform

Navigate to the new folder:

cd /opt/terraform

From the Terraform downloads website, copy the macOS Terraform zip file download link:

copy the Mac OS terraform zip file download link

Download the zip file in the previously created folder:

sudo curl -O <copied_url>

Unzip the Terraform files in the current folder:

sudo unzip <zip_file_name>

The unzipped files will be in the current folder.

Next, add Terraform to the PATH. Navigate to the home folder and execute this command to open and edit the bash profile:

sudo vi ~/.bash_profile

Add these two lines to the opened file:

PATH="/opt/terraform:${PATH}"
export PATH

Execute the file for the path changes to take effect:

source ~/.bash_profile

Now that Terraform is installed, verify the Terraform version by running:

terraform –version

This should show the Terraform version that is installed in the system.

That completes your installation of Terraform on macOS.

How to install Terraform using Homebrew on macOS or Linux

Homebrew installs the latest stable version of Terraform from the HashiCorp tap. If you don’t have the tap added, Homebrew will automatically add it during the install.

To install Terraform using Homebrew on macOS or Linux, run the following command in your terminal:

brew tap hashicorp/tap
brew install hashicorp/tap/terraform

After installation, confirm it worked by running:

terraform version

This should display the installed Terraform version, verifying that it’s correctly set up in your PATH.

If you need a specific version, use:

brew install hashicorp/tap/terraform@1.14.0
brew link hashicorp/tap/terraform@1.14.0 --force

This method is commonly used in DevOps workflows to manage infrastructure with consistent tooling.

Homebrew will install the latest stable Terraform from the official HashiCorp tap. For pinned versions, use terraform@<version> as shown above.

Next step? Import existing infrastructure into Terraform. See more here: How to Import Existing Infrastructure into Terraform (Tutorial with Examples)

Common questions about Terraform installation

Below, we answered the most popular questions users may have when installing Terraform.

Do I need to install Terraform to use it?

Yes, you need to install Terraform locally or use it via a compatible platform. Terraform is a CLI tool, so installing it lets you run commands like terraform init, plan, and apply directly from your terminal.

Alternatively, managed services like Spacelift or HCP Terraform (formerly Terraform Cloud) can run Terraform remotely, abstracting away local setups. However, even then, installing it locally is useful for development and testing workflows before committing changes.

How do I check if I have Terraform installed?

To check if Terraform is installed on your system, run the terraform version command in your terminal. If Terraform is installed and in your system’s PATH, it will return the installed version, like Terraform v1.x.x

If it’s not installed, you’ll see a command-not-found error or similar message. Alternatively, try which terraform (Linux/macOS) or where terraform (Windows) to locate the binary.

How do I add Terraform to my system’s PATH after installation?

After installing Terraform, you should add it to your system’s PATH so the CLI is available globally.

On Linux/macOS

Move the binary:

sudo mv terraform /usr/local/bin/

Verify:

terraform -version

If you prefer a custom path:

  • Add to ~/.bashrc, ~/.zshrc, or ~/.profile:
    export PATH=$PATH:/path/to/terraform
  • Reload shell:
    source ~/.bashrc (or relevant file)

On Windows

  1. Copy terraform.exe to a folder (e.g., C:\Terraform)
  2. Open System Properties → Environment Variables
  3. Under “System variables”, edit Path → Add C:\Terraform
  4. Restart terminal → run terraform -version to confirm.

What directory should I choose to install Terraform?

Install Terraform in a directory included in your system’s PATH so it can be executed globally from the terminal. Common choices:

  • On Linux/macOS: /usr/local/bin/ is typical for user-installed CLI tools.
  • On Windows: Add the folder (e.g., C:\Terraform\) to the system Path environment variable.

Ensure the directory is writable and doesn’t require elevated permissions every time you update Terraform. For local-only use, a custom ~/bin folder also works if added to your PATH.

On multi-user systems, prefer directories like /usr/local/bin or a per-user ~/bin so you don’t need elevated privileges for every upgrade.

Can I install multiple versions of Terraform?

Terraform does not natively support version switching, but this can be managed using tools like tfenv or by scripting custom paths. tfenv is the most popular solution, acting similarly to nvm for Node.js. It allows you to install and switch between specific Terraform versions as needed.

To use tfenv, install it and run:

tfenv install 1.5.7
tfenv use 1.5.7

You can then switch to another version later:

tfenv install 0.14.11
tfenv use 0.14.11

Read more: How to Use tfenv to Manage Multiple Terraform Versions

For Windows users, tfswitch or choco install terraform --version=... is a popular alternative.

You can also manually download and unpack different versions of Terraform in separate directories, then add the desired version to your PATH before execution.

What are common Terraform installation errors, and how do I fix them?

Common Terraform installation errors include path misconfiguration, permission issues, and incompatible binary versions. Most can be resolved by adjusting environment variables or ensuring correct binary usage.

1. Terraform command not found

This usually means the Terraform binary is not in your system’s PATH.

Ensure the Terraform binary is in a directory listed in your PATH variable. For example:

export PATH=$PATH:/usr/local/bin

Or move the binary:

sudo mv terraform /usr/local/bin/

2. Permission denied

This occurs when trying to run Terraform without execute permissions or installing it in a restricted directory.

To grant execute permissions:

chmod +x terraform

Use sudo if installing to system-wide directories:

sudo mv terraform /usr/local/bin/

3. Incompatible version or corrupted binary

If Terraform exits immediately or returns unusual errors, the binary may be corrupted or incompatible with your OS. To fix this, redownload the correct version for your OS/architecture from the Terraform documentation.

4. Checksum verification failure (during terraform init)

Occurs if the Terraform plugin checksum doesn’t match the expected values. Delete .terraform directory and reinitialize:

rm -rf .terraform && terraform init

Make sure you’re not behind a proxy altering responses. 

If you’re using custom providers or private registries, ensure the checksum in .terraform.lock.hcl matches the new binary.

How to uninstall Terraform?

To uninstall Terraform, you need to remove its binary and optionally clean up related files such as plugins or configuration. If you’re doing a clean reset, you may also want to remove ~/.terraform.d/ and any state or configuration files. The exact steps depend on how it was installed.

Uninstallation is complete once the binary is removed and terraform no longer runs from the command line.

Is Terraform still open-source? What about OpenTofu?

Starting with Terraform 1.5, new versions are released under HashiCorp’s Business Source License (BUSL). That’s source-available, but not open-source in the traditional sense.

The last MPL-licensed version of Terraform (1.5.6) was forked as OpenTofu, which continues under a true open-source license.

Spacelift supports both Terraform and OpenTofu, so you can choose whichever is the best fit for your organization’s licensing and governance requirements.

Why use Spacelift to manage your Terraform resources?

Once Terraform is installed, the next step is to run it safely at scale in CI/CD. That’s where Spacelift comes in.

Terraform is really powerful, but to achieve an end-to-end secure GitOps approach, you need a platform that can orchestrate your Terraform workflows. Spacelift is the infrastructure orchestration platform built for the AI-accelerated software era. 

It manages the full lifecycle for both traditional infrastructure as code (IaC) and AI-provisioned infrastructure, giving you access to a powerful CI/CD workflow and unlocking features such as:

  • Policies (based on Open Policy Agent) – You can control how many approvals you need for runs, what kind of resources you can create, and what kind of parameters these resources can have, and you can also control the behavior when a pull request is open or merged.
  • Multi-IaC workflows – Combine Terraform with Kubernetes, Ansible, and other IaC tools such as OpenTofu, Pulumi, and CloudFormation, create dependencies among them, and share outputs.
  • Build self-service infrastructure – You can use Templates and Blueprints to build self-service infrastructure; simply complete a form to provision infrastructure based on Terraform and other supported tools.
  • AI-powered provisioning and diagnosticsSpacelift Intelligence adds an AI-powered layer for natural language provisioning, diagnostics, and operational insight across your infrastructure workflows.
  • Integrations with any third-party tools – You can integrate with your favorite third-party tools and even build policies for them. For example, see how to integrate security tools in your workflows using Custom Inputs.

Spacelift enables you to create private workers inside your infrastructure, which helps you execute Spacelift-related workflows on your end. Read the documentation for more information on configuring private workers.

You can check it for free by creating a trial account or requesting a demo with one of our engineers.

Key points

Terraform lets you convert an entire cloud infrastructure into configuration or code files. These files can be used to quickly and easily spin up the entire infrastructure. Anyone can use it to manage cloud infrastructure with any cloud provider.

In this post, we went through the steps to install Terraform on Windows, Linux, and macOS. I hope this helps you with your installations. If you’re interested in upgrading Terraform to the latest version, see Upgrading Terraform to the Latest Version.

Terraform management made easy

Orchestrate your Terraform workflows and build governed pipelines using policy as code, programmatic configuration, context sharing, drift detection, resource visualization, and many more.

Start free trial

Terraform Commands Cheat Sheet

Grab our ultimate cheat sheet PDF
for all the Terraform commands
and concepts you need.

Share your data and download the cheat sheet