Skip to main content
This guide shows multiple ways to install Terraform so you can run infrastructure-as-code across different platforms. It covers local installations for Windows, macOS, and Linux, plus an option to use Terraform from Azure Cloud Shell. Follow the steps that best match your workflow and operating system. Installing Terraform locally is a straightforward three-step process:
  1. Download the Terraform binary (or install via a package manager) for your operating system.
  2. Ensure Terraform is available on your system PATH.
  3. Verify the installation.
The image outlines the steps for installing Terraform locally, including downloading the Terraform binary, installing and configuring the PATH, and verifying the installation.
Installation quick reference Windows Example (Chocolatey):
If you downloaded the portable ZIP, extract terraform.exe and move it into a directory on the system PATH (for example C:\Program Files\Terraform), or add the directory to the system PATH. macOS
  • Recommended: Homebrew with the HashiCorp tap. This handles installation and updates for you.
Alternatively, download the correct binary for Intel or Apple Silicon from the official Terraform releases page and place the terraform binary in a directory on your PATH (for example /usr/local/bin). Linux (Debian / Ubuntu example)
  • Use the official HashiCorp APT repository to get signed packages and automatic updates. Run these commands:
For RHEL/CentOS, Fedora, SUSE, or other distributions, follow the corresponding steps in the official Terraform installation docs or use the generic ZIP binary to place terraform on your PATH. Verify installation (common to all platforms)
You can also run:
This displays common commands such as init, validate, plan, apply, and destroy. Using Terraform from Azure Cloud Shell If you need a quick environment without local installation, use Terraform from Azure Cloud Shell. Cloud Shell is a browser-based shell with Terraform pre-installed—ideal for demos, learning, and quick experiments.
The image is a three-step flowchart showing how to use Terraform via Azure Cloud Shell: Open Azure Cloud Shell, use pre-installed Terraform, and start using Terraform.
To use Cloud Shell:
  • Open the Azure portal and click the Cloud Shell icon in the top bar.
  • If this is your first time, Cloud Shell prompts you to create or select a storage account (the portal can create one).
  • When provisioned, a terminal session appears and Terraform is available immediately—no local install required.
The image shows the Microsoft Azure portal interface with options for Azure services and resources, along with a Cloud Shell terminal being connected at the bottom.
Azure Cloud Shell is great for quick tests, demos, or when you’re away from your usual workstation. It is not recommended as the primary environment for production Terraform workflows—use CI/CD pipelines or local development environments for reproducible, auditable runs.
Common Terraform commands (summary) Where to find the official instructions Next steps
  • After installing Terraform, authenticate Terraform to Azure so you can manage Azure resources. Common authentication methods include:
    • Azure CLI (az login) for interactive sessions
    • Service principals for automation
    • Managed identities for Azure-hosted agents
Recommended workflows for Terraform in production (CI/CD, state backends, workspaces, and governance) are covered in separate guidance and best-practice documents. Links and References

Watch Video