Resources

See more info here in the docs:

Approaches to install

The downside of the binary approach is requires manually checking for a version in the browser on an initial install and on every upgrade.

The approaches using a package manager are more convenient to install and upgrade, without needing a browser.

Download binary

  1. Go to Download Terraform page on Terraform website or see the list releases if you need an older version.
  2. Download an archived binary.
  3. Unzip it.
  4. Move terraform to your executables directory in your PATH.

e.g. for macOS/Darwin:

$ cd ~/Downloads
$ wget https://releases.hashicorp.com/terraform/1.0.5/terraform_1.0.5_darwin_amd64.zip
$ tar xzvf terraform_1.0.5_darwin_amd64.zip
$ mv terraform /usr/local/bin

Or, if you want to keep it separate from any existing Terraform versions intalled.

$ mv terraform /usr/local/bin/terraform1.0
$ terraform1.0 -v

Homebrew on macOS

Plain

This approach seems no longer covered by the doc.

$ brew install terraform

Upgrade:

$ brew upgrade terraform

Tap

An alternative.

$ brew tap hashicorp/tap
$ brew install hashicorp/tap/terraform

Update:

$ brew update # Maybe not needed since update is always done, at least not for taps.
$ brew upgrade hashicorp/tap/terraform

Ubuntu/Debian on Linux

You can use apt / apt-get to manage Terraform. But first you hav to add to your Debian repositorities.

  1. Add the HashiCorp GPG key:
     $ curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
    
  2. Add the official HashiCorp Linux repository:
     $ sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
    
  3. Update and install.
     $ sudo apt-get update
     $ sudo apt-get install terraform
    

Verify installation

$ terraform -v
Terraform v1.0.5
on darwin_amd64