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
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.
- Download the main file to your computer
- The Terraform zip file will be saved to your download folder
- 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
- Download GPG4win from www.gpg4win.org
- On the thanks for download page click check integrity.
- Locate the SHA256 checksums
Open powershell and use the Get-Filehash command to validate with website correct code.
- Compare the Hash on the website, and the hash output from your local computer powershell session (as above).
- If they both match you know you have a clean file.
- Once all checks out you can safely Install gpg4win
- Open powershell and run gpg –import hasicorp.asc
- 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)
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
Open text file and compare
If they MATCH you are good to go!
- Next extract terrarform zip
- Next run terraform