Here is how to install Terraform on macOS in 2026. Tested and verified.
Method 1: Homebrew (Recommended)
brew tap hashicorp/tap
brew install hashicorp/tap/terraformMethod 2: Direct Download
# Download (check https://releases.hashicorp.com/terraform/ for latest)
curl -LO https://releases.hashicorp.com/terraform/1.9.0/terraform_1.9.0_darwin_arm64.zip
unzip terraform_1.9.0_darwin_arm64.zip
sudo mv terraform /usr/local/bin/
rm terraform_1.9.0_darwin_arm64.zipVerify
terraform --versionEnable Shell Completion
terraform -install-autocompleteQuick Start
mkdir ~/terraform-demo && cd ~/terraform-demo
cat > main.tf << 'EOF'
terraform {
required_providers {
local = {
source = "hashicorp/local"
}
}
}
resource "local_file" "hello" {
content = "Hello, Terraform!"
filename = "${path.module}/hello.txt"
}
EOF
terraform init
terraform plan
terraform apply -auto-approve
cat hello.txt
terraform destroy -auto-approve
