<aside> ⛔ Terraform is pre installed on the Ubuntu VM. You can skip this part if you are using the premade VM

</aside>

Terraform Official Documentation

Install Terraform | Terraform - HashiCorp Learn

Install

Linux

Ensure that your system is up to date, and you have the GnuPG, software-properties-common, and curl packages installed. You will use these packages to verify HashiCorp's GPG signature and install HashiCorp's Debian package repository.

sudo apt-get update && sudo apt-get install -y gnupg software-properties-common curl

Add the HashiCorp GPG key.

curl -fsSL <https://apt.releases.hashicorp.com/gpg> | sudo apt-key add 

Add the official HashiCorp Linux repository.

sudo apt-add-repository "deb [arch=amd64] <https://apt.releases.hashicorp.com> $(lsb_release -cs) main"

Update to add the repository, and install the Terraform CLI.

sudo apt-get update && sudo apt-get install terraform

MacOS

Install Homebrew

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

First, install the HashiCorp tap, a repository of all our Homebrew packages.

brew tap hashicorp/tap

Now, install Terraform with hashicorp/tap/terraform.