How to Install Terraform on Windows

Terraform is extremely popular on Linux, but it is now also available on Windows. You need to have PowerShell version 4 or greater installed so it is recommended to install on the following Microsoft Windows products:

  • Windows 10 Desktop
  • Windows Server 2012
  • Windows Server 2016

It may work on other Windows versions, but this is not something that I have tested myself.

How to download Terraform for Windows?

Download file from www.terraform.io and select the Windows 32bit or 64bit option

https://www.terraform.io/downloads.html

In this example you will be shown how to validate the version of Terraform is genuine. This is vital if using in a production environment.

  1. Download the main file to your computer
  2. The Terraform zip file will be saved to your download folder
  3. Simply Extract the file a location of your choice.

Now we need to validate the Terraform binaries are genuine. In this section you will :

  • Download the SHA256 checksums for Terraform
  • Download the Verify the checksums signature file
  • Get the HashiCorps GPG key
  1. Download GPG4win from www.gpg4win.org 
  2. On the thanks for download page click check integrity.
  3. Locate the SHA256 checksums

Open powershell and use the Get-Filehash command to validate with website correct code.

http://54.154.77.54/wp-content/uploads/2018/11/word-image-128.png

  1. Compare the Hash on the website, and the hash output from your local computer powershell session (as above).
  2. If they both match you know you have a clean file.
  3. Once all checks out you can safely Install gpg4win
  4. Open powershell and run  gpg –import hasicorp.asc
  5. Then verify the hash with gpg –verify .\terraform_0.11.7_SHA256SUMS.sig .\terraform_0.11.txt  (note your command may vary if you are using a newer version of Terraform)

http://54.154.77.54/wp-content/uploads/2018/11/word-image-130.png

Next use get-filehash in powershell. Ensure you select the path of your version

Example – Get-FileHash -Path .\terraform_0.11.7.windows_amd64.zip -Algorithm SHA256

http://54.154.77.54/wp-content/uploads/2018/11/word-image-131.png

Open text file and compare

http://54.154.77.54/wp-content/uploads/2018/11/word-image-132.png

If they MATCH you are good to go!

  1. Next extract terrarform zip
  2. Next run terraform

http://54.154.77.54/wp-content/uploads/2018/11/word-image-133.png

Elsewhere On TurboGeek:  Installing Glances on Linux

You may also like...

3 Responses

  1. 29/01/2021

    […] Beginners Terraform on AWS, Azure and GCP […]

  2. 19/10/2022

    […] How to Install Terraform on Windows […]

  3. 02/11/2022

    […] Learn how to install Terraform on Windows here. […]

Leave a Reply

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