In this article, we are going to see about the installation of Terraform in Windows.

There are 2 ways to install Terraform in Windows. They are as follows:

  1. The Hard way
  2. The Easy way

1. The Hard way

In the hard way, we can install manually by downloading the binary file and adding the same to system path environment variable.

Step 1: 

Kindly download the binary from Terraform’s downloads page based on the architecture of the machine.

Terraform Downloads Page
Terraform Downloads Page

For this demo, I am using the binary of Windows 64-bit type.

Step 2:

Kindly create a folder in C drive as “terraform” and copy the downloaded binary to the created folder.

Step 3:

Kindly extract the binary file in the same folder.

Step 4:

Kindly open your Start Menu and type in “environment” and the first thing that comes up should be Edit the System Environment Variables option. Click on that to open the System Properties window.

System Properties Window
System Properties Window

Step 5:

Kindly click on the option “Environment Variables” at the bottom.

Step 6:

It will open the Environment Variables Window with 2 sections:  User Variables and System Variables. Under System Variables, kindly select the variable “Path” and click Edit.

System Variables
System Variables

Step 7:

In the Edit Environment Variable section, kindly click “New” to create a new entry and enter the folder path where terraform.exe is located at the bottom of the list.

Edit Environment Variables
Edit Environment Variable

Step 8:

Kindly click “OK” to close the opened windows.

Step 9: 

Now, open the CMD / Powershell and enter the command “refreshenv“, so that Windows can detect the new path.

Step 10:

Kindly enter the command “terraform –version” to verify the installation.

Terraform Validation
Setup Validation

 

2. The Easy way

In the easy way, we can install using the windows package manager called Chocolatey

Step 1:

Kindly open a CMD/PowerShell prompt as an administrator and install Chocolatey using the command from their install page.

Step 2:

After the installation of Chocolatey, run the command “choco install terraform” and approve the same to start the installation.

Choco installation of Terraform
Choco installation of Terraform

Step 10:

Kindly enter the command “terraform –version” to verify the installation.

We successfully installed the terraform in a Windows machine.

Share and Enjoy !

0Shares
0 0 0

Leave a Reply

Your email address will not be published. Required fields are marked *