Install Terraform on macOS

From Bonus Bits
Jump to: navigation, search

Purpose

This article gives a couple options on how to install or setup Terraform on a macOS Sierra system. The first optional way is to use HomeBrew. Which simplifies the install process and makes updating easy too.


Prerequisites

  • Homebrew (IF going Homebrew way instead of downloading zip.)


Homebrew (Option 1)

The easiest and quickest way to install Terraform is using Homebrew.

brew install terraform

Install Example

==> Downloading https://homebrew.bintray.com/bottles/terraform-0.9.1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring terraform-0.9.1.sierra.bottle.tar.gz
==> Caveats
zsh completion has been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
🍺  /usr/local/Cellar/terraform/0.9.1: 7 files, 131.6MB


Gnome-sticky-notes-applet.png A symlink will be created for the binary /usr/local/bin/terraform -> ../Cellar/terraform/0.9.1/bin/terraform

Upgrading

brew update
brew upgrade


Manually (Option 2)

The versions seem to be bottled up very quickly with HomeBrew so I see little reason why to do a manual install, but this is how you do it.

  1. Download binary zip from HashiCorp
    https://www.terraform.io/downloads.html
  2. Unzip
  3. Copy binary to a place in the path such as /usr/local/bin/terraform
    cp $HOME/Downloads/terraform /usr/local/bin/
    


Verify Install

A simple test that the binary is in the path and such is to call the version.

terraform -v

Example

Terraform v0.9.1


Sources