Install Terraform on Windows: Step-by-Step Guide
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! β Step 1: Download Terraform Visit the official Terraform website: Terraform Downloads Select Windows and choose the appropriate version (typically amd64 for most users). Click Download and save the file. π₯ Once the download completes, proceed to the next step. π¦ Step 2: Extract the Terraform Files Locate the downloaded .zip file. Use a tool like WinRAR, 7-Zip, or Windows Extractor to extract the contents. You will find a single file named terraform.exe. Β π‘ Tip: Create a dedicated folder like C:terraform and moveΒ Β terraform.exe there. βοΈ Step 3: Add Terraform to System Path To run Terraform from any command prompt, add it to your system’s Path variable. Search for Environment Variables from the Start Menu. Click on Edit the system environment variables β Environment Variables. Under System Variables, locate the variable named Path and click Edit. Click New and enter the path where you placed terraform.exe (e.g., C:terraform). 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. Open Command Prompt or PowerShell. Run the following command: terraform version You should see the installed Terraform version displayed. π Congratulations! Terraform is successfully installed. π 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-democd 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 initterraform 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! https://srtechops.com/wp-content/uploads/2025/01/Remainder-App-Technology-Logo.mp4 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. Feature Self-Paced Training Live 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 Info Explore Self-Paced Training Explore Live Training




