Terraform is very easy to install and can run on your desktop or a remote server. You can download Terraform from the Terraform download page. Select the appropriate package for your operating system and architecture (on macOS, you only have one option - 64-bit), click the download link to download the ZIP archive, and unzip it into the directory where you want Terraform to be installed. The archive will extract a single binary called
terraform, which you’ll want to add to your
PATH environment variable. Alternatively, Terraform might be available in your operating system’s package manager; for example, you can run
brew install terraform on macOS if you have Homebrew installed. You can also install Terraform inside a Docker container.
Here are the steps to install Terraform binary directly from Terraform:
mkdir ~/bin echo "export PATH="$PATH:$HOME/bin"" >> ~/.bash_profile wget https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_darwin_amd64.zip unzip terraform_0.12.24_darwin_amd64.zip mv terraform ~/bin terraform -version # Terraform v0.12.24
If you use Homebrew, just issue:
brew install terraform
That's it. Very simple and easy.