Skip to content

🧰 Terraform CLI Installation Guide (macOS)

📋 Overview

This guide describes how to install the Terraform CLI on a macOS system using Homebrew. Terraform is an Infrastructure as Code (IaC) tool that lets you define, provision, and manage cloud infrastructure declaratively.


⚙️ Prerequisites

  • macOS (Intel or Apple Silicon)
  • Homebrew package manager installed
  • Internet connectivity for downloading the Terraform binary

To verify that Homebrew is installed, run:

brew -v

If Homebrew is missing, install it with:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

🚀 Installation Steps

1. Update Homebrew

Refresh your local Homebrew repository to ensure you have the latest package definitions:

brew update

2. Install Terraform

Run the following command to install Terraform via Homebrew:

brew install terraform

This will:

  • Download the latest stable version of Terraform
  • Place the binary in your Homebrew-managed PATH (usually /usr/local/bin or /opt/homebrew/bin)

3. Verify the Installation

Check that Terraform is correctly installed:

terraform -version

Example output:

Terraform v1.9.5
on darwin_arm64

If you see a version number and platform (e.g., darwin_arm64 or darwin_amd64), Terraform is successfully installed.


🧩 Post-Installation (Optional)

To update Terraform later:

brew upgrade terraform

To uninstall Terraform:

brew uninstall terraform