fbpx

Install Terraform on Windows: Step-by-Step Guide

Terraform is a powerful Infrastructure as Code (IaC) tool used to manage cloud resources efficiently. In this guide, you’ll learn how to install Terraform on Windows quickly and correctly. Whether you’re new to cloud automation or switching systems, knowing how to install Terraform on Windows is essential. Follow along as we walk you through the steps to install Terraform on Windows and get started!

Install Terraform on Windows

✅ Step 1: Download Terraform

  1. Visit the official Terraform website: Terraform Downloads

  2. Select Windows and choose the appropriate version (typically amd64 for most users).

  3. Click Download and save the file.

📥 Once the download completes, proceed to the next step.

📦 Step 2: Extract the Terraform Files

  1. Locate the downloaded .zip file.

  2. Use a tool like WinRAR, 7-Zip, or Windows Extractor to extract the contents.

  3. You will find a single file named terraform.exe.

  💡 Tip: Create a dedicated folder like C:\terraform and move  terraform.exe there.

Install Terraform on Windows
Install Terraform on Windows

⚙️ Step 3: Add Terraform to System Path

To run Terraform from any command prompt, add it to your system’s Path variable.

  1. Search for Environment Variables from the Start Menu.

  2. Click on Edit the system environment variablesEnvironment Variables.

  3. Under System Variables, locate the variable named Path and click Edit.

  4. Click New and enter the path where you placed terraform.exe (e.g., C:\terraform).

  5. Click OK to save the changes.

🧑‍💻 With this done, Terraform is now accessible from your terminal.

🧪 Step 4: Verify Installation

Now it’s time to check if Terraform is installed correctly.

  1. Open Command Prompt or PowerShell.

  2. Run the following command:

terraform version

  1. You should see the installed Terraform version displayed.

🎉 Congratulations! Terraform is successfully installed.

Install Terraform on Windows

🚀 Bonus: Install Using Chocolatey (Optional)

If you have Chocolatey installed, you can install Terraform with one command:

choco install terraform

This method is faster and automatically adds Terraform to your system path.

🙌 Next Steps

Now that you have Terraform installed, you can start building and managing cloud infrastructure. Try running:

terraform init

🏁 Run Your First Terraform Script

Here is a simple example to create two AWS EC2 instances using Terraform.

1.Create a new directory and navigate to it:

mkdir terraform-aws-demo
cd terraform-aws-demo

2.Create a file named main.tf and add the following content:

provider “aws” {
        region = “us-east-1”
        access_key = “YOUR_ACCESS_KEY”
        secret_key = “YOUR_SECRET_KEY”
}

resource “aws_instance” “myfirstVM” {
        count = 2
        ami = “ami-08b5b3a93ed654d19”
        instance_type = “t2.micro”
        key_name = “terraformserverkey”
tags = {
       Name = “linuxserver”
    }
}

⚠️ Ensure your access and secret keys are correct. Never share your keys publicly.

3.Initialize and apply the configuration:

terraform init
terraform apply

4 .Confirm with yes when prompted.

✅ Your AWS EC2 instances will be created shortly. Congratulations on running your first Terraform script!

💬 Need help? Drop your questions in the comments!

Devops Multi cloud Training

Choose the training style that fits your schedule — Self-Paced or Live Interactive Sessions. Both include hands-on projects, expert support, and lifetime access.

FeatureSelf-Paced TrainingLive Training
🎯 Mode🎥Pre-Recorded Session🧑‍🏫Live Class + Recordings
💼 Projects🕒 Weekend Real-Time Projects📅 Weekdays + Weekend Real-Time Projects
❓ Doubt Clearing📞 Weekend Live Support Session🧠 Anytime Doubt Clearing Session
👥 Career Support & Mentorship❌ No✅ Yes
🎓 Global Certification Training❌ No✅ Yes
🔑 Access♾️ Lifetime Access♾️ Lifetime Access
💰 Fees₹4,999 (2 x ₹2,500)₹7,999 (2 x ₹4,000)
ℹ️ For More InfoExplore Self-Paced Training Explore Live Training

Leave a Comment

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

Open chat
Hello, Good day!!
How can we help you?