Before the Terraform Magic Happens...
In one of my team meetings recently, one of the junior members of the team asked about the install troubles he was having, I realized that I even had some issues installing the basic files needed. Even for experienced engineers, the actual installation and basic configuration on Windows 11 can be a bit of a hurdle. Here is exactly how to get your environment ready.
## Prerequisites
The assumption is you already have an Azure account. If you don't, sign up here for a free account.
## Method 1: Manual Installation
The best place to start is the official HashiCorp site.
- Download: Go to the Terraform Downloads page.
-
Choose your Version:
- 386: For 32-bit systems.
- AMD64: For 64-bit systems (Most modern Windows 11 laptops).
-
Extract: Right-click the downloaded zip and extract
terraform.exe.
### Setting the Path
- Create a folder (e.g.,
C:\terraform) and move the.exethere. - Click the Start Menu and type "Environment Variables".
- Under System Variables, find Path, click Edit, and add
C:\terraform.
### Testing your Terraform configuration
Test your terraform install by opening up PowerShell and type terraform.

## Method 2: The "Chocolatey" Way (Recommended)
If you prefer a package manager, this is much faster.
## Prerequisites
PowerShell, run as administrator. This is installed by default so 1 less install yey!!
But just in case you want to run PowerShell 7 go
PowerShell.
Get chocolatey.
you will need to run a few PowerShell commands during this step but the steps are pretty straight forward to complete.
### 1. Setup PowerShell
Launch PowerShell as Administrator and check your execution policy:
Get-ExecutionPolicy

If it returns the above run the following command
Or run this command
Set-ExecutionPolicy Bypass -Scope Process
### 2. Install Chocolatey
Run the following command to install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
### 3. Test your Chocolatey install
Test your install for chocolatey by opening up PowerShell
and type the following command
choco

After you see the above run the following command to install terraform
choco install terraform
Once installed check terraform installation by running the following command
terraform






Top comments (0)