Installing Terraform is very easy, it’s available as a single binary named terraform.
1. Download the zip archive
Go to the Terraform Downloads page and download the appropriate package for your system.
bash
$# Example downloading the 64-bit Linux zip archive
$wget https://releases.hashicorp.com/terraform/0.12.26/terraform_0.12.26_linux_amd64.zip2. Unzip the package
bash
$# Unzip the downloaded archive
$unzip terraform_0.12.26_linux_amd64.zip
Archive: terraform_0.12.26_linux_amd64.zip
inflating: terraformIf you don’t have unzip installed, then you can install it for example on Debian based systems:
bash
$sudo apt-get install unzip3. Move the binary to a location available in your PATH
View the list of locations in your PATH:
bash
$# The locations are separated by colons (:)
$echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/gamesMove the terraform binary to one of the listed locations:
bash
$sudo mv terraform /usr/local/bin/terraform4. Verify the installation
bash
$# You should be able to run terraform from any location
$terraform version
Terraform v0.12.265. Enable tab completion (Optional)
You can enable tab completion if you’re using bash or zsh.
bash
$terraform -install-autocompleteThen you can use the Tab key to autocomplete Terraform commands.