In this article we are going to cover the steps to install Terraform on windows.
Introduction
Terraform is an open-source infrastructure as code (IAC) tool developed by HashiCorp. It allows developers and operations teams to define and manage infrastructure resources, such as servers, storage, networking, and security policies, using a high-level configuration language. With Terraform, infrastructure resources can be treated as code, which means that changes can be versioned, tested, and automated, providing better control, consistency, and agility. Terraform supports a wide range of cloud and on-premises providers, including Amazon Web Services (AWS), Microsoft Azure, Google Cloud Platform (GCP), and VMware.
Prerequisites
- Windows operating system
- Administrative privileges
- Internet connection
Steps to Install Terraform on Windows
Step #1: Download Terraform:
- 1. Open a web browser and go to the official Terraform website:
https://www.terraform.io/downloads.html
. - Scroll down to the “Terraform” section and look for the Windows download option. It should display the latest version available for Windows. Click on the link to download the Terraform binary for Windows. Make sure to choose the 64-bit version if your Windows operating system is 64-bit.
![](https://rushiinfotech.in/wp-content/uploads/2023/08/02-copy-1024x460.png)
Step #2: Extract the Terraform Binary
- 1. Once the download is complete, open the folder where the binary was downloaded (usually the “Downloads” folder).
![](https://rushiinfotech.in/wp-content/uploads/2023/08/04-copy-1024x192.jpg)
- Locate the downloaded zip file (e.g., ‘terraform.zip’) and extract its contents. You can do this by right-clicking the zip file and selecting “Extract All” or using a tool like 7-Zip.
- After extraction, you should have a file named terraform.exe. This is the Terraform executable.
Step #3: Add Terraform to the System PATH
To run the terraform command from any command prompt or PowerShell window, you need to add its location to the system PATH variable.
- Right-click on the Windows Start button and select ‘System’.
![](https://rushiinfotech.in/wp-content/uploads/2023/08/15-1-1024x576.png)
- Click on ‘Advanced system settings’ on the right side.
![](https://rushiinfotech.in/wp-content/uploads/2023/08/06-copy-1024x319.png)
- In the ‘System Properties’ window, click on the ‘Environment Variables…’ button.
![](https://rushiinfotech.in/wp-content/uploads/2023/08/07-copy-1024x398.png)
- Under ‘System Variables’, find and select the ‘Path’ variable, then click ‘Edit…’
![](https://rushiinfotech.in/wp-content/uploads/2023/08/08-copy-1024x258.png)
- In the ‘Edit Environment Variable’ window, click on ‘New’ and paste in the path to the directory where you extracted the Terraform binary (e.g.,
C:\Terraform
).
![](https://rushiinfotech.in/wp-content/uploads/2023/08/09-copy-1024x468.png)
- Click ‘OK’ on each open window to save and apply the changes.
Step #4: Verify the Installation
Open a new Command Prompt or PowerShell window (make sure it’s a new one so it has the updated PATH variable).
Type in the following command:
terraform --version
![](https://rushiinfotech.in/wp-content/uploads/2023/08/12-copy-2-1024x274.png)
- If the installation was successful, this will display the Terraform version you installed.
Conclusion
Installing Terraform on a Windows machine is a straightforward process that involves downloading the binary, adding it to the system’s PATH, and verifying the installation. Once installed, Terraform empowers you to manage your infrastructure as code efficiently, enabling you to automate and streamline your deployment processes. With Terraform on Windows, you’re ready to embark on your journey to infrastructure automation and orchestration.
For Reference:
The official website of Terraform.
Any queries pls contact us
https://rushiinfotech.in/contact/