---
title: "How to Install Terraform on Linux and Windows"
description: "Terraform is the most popular automation tool to build, change and manage your cloud infrastructure in an effective and quick way. Jump in this article to learn how to install Terraform on your Linux and Windows devices!"
canonical: "https://adamtheautomator.com/install-terraform/"
---

# How to Install Terraform on Linux and Windows

> Terraform is the most popular automation tool to build, change and manage your cloud infrastructure in an effective and quick way. Jump in this article to learn how to install Terraform on your Linux and Windows devices!

Source: https://adamtheautomator.com/install-terraform/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![How to Install Terraform on Linux and Windows](https://adamtheautomator.com/wp-content/uploads/2021/10/How-to-Install-Terraform-on-Linux-and-Windows.jpg)

# How to Install Terraform on Linux and Windows

[![](https://secure.gravatar.com/avatar/2beb65fca997135120ed98dc6a2e57dcdf1a7d7d2f5ff687b5d91dc7ccd7a6b5?s=192&d=mm&r=g)Sagar](https://adamtheautomator.com/author/shanky-mendiratta/)6 October 20213 min. read

Categories: [Cloud](/category/cloud/)

Tags:[Automation](/tag/automation/)[Terraform](/tag/terraform/)[Ubuntu Linux](/tag/ubuntu-linux/)[Windows](/tag/windows/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Installing Terraform on a Windows Device](#installing-terraform-on-a-windows-device)
*   [Installing Terraform with Package Repositories on Ubuntu](#installing-terraform-with-package-repositories-on-ubuntu)
*   [Installing Terraform with Zip Files on Any Linux Device](#installing-terraform-with-zip-files-on-any-linux-device)
*   [Conclusion](#conclusion)

Are you overwhelmed with the number of cloud services and resources you have to manage? Do you wonder what tool can help with these chores? Wonder no more and dive right in! This tutorial will teach how to install [Terraform](https://www.terraform.io/intro)!

Terraform is the most popular automation tool to build, change and manage your cloud infrastructure effectively and quickly. So let’s get started!

## **Prerequisites**

This how-to will be a step-by-step tutorial on Terraform. If you’d like to follow along, be sure you have the following:

*   A Windows 10+ device.
*   A device with Ubuntu 18.04 or later. The examples in this tutorial will use Ubuntu 18.04.

## Installing Terraform on a Windows Device

To get started read below to learn how to install Terraform on a Windows device.

1\. Open your favorite browser and download the appropriate version of Terraform from [HashiCorp’s Terraform releases page](https://releases.hashicorp.com/terraform/). The examples use [version 1.0.6](https://releases.hashicorp.com/terraform/1.0.6/terraform_1.0.6_windows_amd64.zip).

> _At the moment of the writing, the latest Terraform version is 1.0.6. The examples will use this version._

2\. Create a _tools_ folder in your _C:\\_ drive.

3\. Extract the downloaded archive file and copy the _terraform.exe_ into the previously created _C:\\tools_ folder.

4\. Next, open your Start Menu and type in **environment system,** and the first search result that comes up should be **Edit the System Environment Variables** command. Click on the search result and will see the **System Properties** window as shown below.

![Editing the System Environment Variables](https://adamtheautomator.com/wp-content/uploads/2021/10/image-89.png)

Editing the System Environment Variables

5\. Now find the **Path** environment variable and click **Edit** to change it.

![Updating the Path by adding the Terraform executable path](https://adamtheautomator.com/wp-content/uploads/2021/10/image-90.png)

Updating the Path by adding the Terraform executable path

6\. Click **New** and add the folder path where you extracted _terraform.exe_, which is _C:\\tools\\terraform.exe_, and click **OK**.

![Adding the Terraform path into the PATH environment variable.](https://adamtheautomator.com/wp-content/uploads/2021/10/image-91.png)

Adding the Terraform path into the PATH environment variable

> _The screenshot above shows a sub-directory path with the version included, this is optional._

7\. Open a Command Prompt or PowerShell to check if Terraform is correctly added to the environmental variable PATH. Run the `terraform` command and you will see an output similar to that shown below.

![Determining if Terraform is installed](https://adamtheautomator.com/wp-content/uploads/2021/10/image-92.png)

Determining if Terraform is installed

8\. As a good practice, you should also consider running the `terraform --version` to confirm the version of Terraform installed. You should see `1.0.6` if you are following along.

![Verifying the version of Terraform installed](https://adamtheautomator.com/wp-content/uploads/2021/10/image-93.png)

Verifying the version of Terraform installed

## Installing Terraform with Package Repositories on Ubuntu

Now learn how to install Terraform on Linux, specifically on Ubuntu. You will install Terraform via package repositories for easier integration with configuration management tools with the `apt install` command.

1\. SSH into an Ubuntu machine with your favorite SSH client.

2\. Create a directory to hold your Terraform installation files. Although you can install Terraform in any directory, it is recommended to install software under the _opt_ directory. Create the _terraform_ directory with the [`mkdir`](https://linux.die.net/man/1/mkdir) command. Navigate into that directory with the `cd` command, as shown below.

```bash
# Creating the directory terraform under opt and changing to this directory.
mkdir /opt/terraform
cd /opt/terraform
```

![Creating the Terraform directory](https://adamtheautomator.com/wp-content/uploads/2021/10/image-94.png)

Creating the Terraform directory

3\. Next, configure your system to trust the HashiCorp key for package authentication by running the `curl` command below. After you run the command you will see an `OK` message. The connection between your Ubuntu device and the Hashicorp site is now secure.

> _Although this tutorial uses the root user, it is typically best practice to use a less-privileged account member of the [sudoers group](https://help.ubuntu.com/community/RootSudo)._

```bash
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
```

![ Trusting the HashiCrop site by adding the key on the ubuntu machine ](https://adamtheautomator.com/wp-content/uploads/2021/10/image-95-1024x41.png)

Trusting the HashiCrop site by adding the key on the ubuntu machine

4\. After registering the key, add the official HashiCorp repository to your system by running the `apt-add-repository` command. The Hashicorp repository contains the Terraform installation package.

```bash
sudo apt-add-repository "deb [arch=$(dpkg --print-architecture)] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
```

![Adding the HashiCrop repository on the ubuntu machine](https://adamtheautomator.com/wp-content/uploads/2021/10/image-96.png)

Adding the HashiCrop repository on the ubuntu machine

5\. Install Terraform from the newly added Hashicorp repository using the `apt install` command.

```bash
sudo apt install terraform
```

![Installing the terraform package on an ubuntu machine](https://adamtheautomator.com/wp-content/uploads/2021/10/image-97.png)

Installing the terraform package on an ubuntu machine

6\. Check your Terraform installation by running the `terraform` command. You should see an output similar to the one below.

![Verifying the terraform installation ](https://adamtheautomator.com/wp-content/uploads/2021/10/image-98.png)

Verifying the terraform installation

## Installing Terraform with Zip Files on Any Linux Device

Not every Linux distro has access to the apt tools. As an alternative, install Terraform from zip files. Let’s check how to accomplish that!

1\. Create the _/opt/terraform_ directory and navigate to it with the `mkdir` and `cd` commands, as shown below.

```bash
# Creating the directory terraform under opt and changing to this directory.
mkdir /opt/terraform
cd /opt/terraform
```

![Creating the Terraform directory](https://adamtheautomator.com/wp-content/uploads/2021/10/image-99.png)

Creating the Terraform directory

2\. Download the appropriate version of Terraform from [HashiCorp’s Terraform releases page](https://releases.hashicorp.com/terraform/). The example below downloads version 1.0.6 with `wget` to the current directory.

```bash
wget https://releases.hashicorp.com/terraform/1.0.6/terraform_1.0.6_linux_amd64.zip
```

![Downloading the Terraform 1.0.6 executable](https://adamtheautomator.com/wp-content/uploads/2021/10/image-100.png)

Downloading the Terraform 1.0.6 executable

3\. After a successful download, extract the Terraform archive to the current directory with the [`unzip`](https://linux.die.net/man/1/unzip) command.

```bash
unzip terraform_1.0.6_linux_amd64.zip
```

Run the `ls` command to confirm that the _terraform_ binary file is present.

![extract the Terraform archive to the current directory](https://adamtheautomator.com/wp-content/uploads/2021/10/image-101.png)

extract the Terraform archive to the current directory

4\. Now, move the _terraform_ binary to the executable directory _/usr/local/bin._ The executable directory (_`/usr/local/bin`_) allows you to run the executable files from anywhere in the Linux system.

```bash
sudo mv terraform /usr/local/bin
```

Finally, verify if terraform has been installed successfully by running the `terraform --version` command.

## Conclusion

In this tutorial, you learned how to install Terraform on both Ubuntu and Windows devices. Now that you have Terraform downloaded and set up, what do you plan to manage with it?

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Finstall-terraform%2F&text=How%20to%20Install%20Terraform%20on%20Linux%20and%20Windows)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Finstall-terraform%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Finstall-terraform%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2026/08/featured_image-7.webp)

### [Build Azure Landing Zones That Prevent Cloud Sprawl](/build-azure-landing-zones/)

Build governed Azure landing zones end to end with the IaC accelerator: management group hierarchies, the eight design areas, Terraform and Bicep deployments,

![](https://adamtheautomator.com/wp-content/uploads/2026/08/featured_image-1.webp)

### [Survive the Senior Cloud Engineer AWS Interview Loop](/senior-cloud-engineer-interview-loop/)

Prepare for a senior cloud engineer interview with AWS EKS and Control Tower system design reasoning, Terraform locking, and salary negotiation tactics.

![](https://adamtheautomator.com/wp-content/uploads/2026/07/featured_image-3.webp)

### [Power Automate: Build a Reliable AI Document Intake Pipeline](/power-automate-document-intake-pipeline/)

Build a Power Automate intake pipeline that deduplicates Outlook attachments, extracts fields with AI Builder, and routes low-confidence results to Teams.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
