This guide contains instructions on how to install Terraform on an Ubuntu system.
- Operating System : Ubuntu 18.04
- Access to a Terminal or Shell Console
01: Download the installer at https://www.terraform.io/downloads.html for system architecture. Or you can use the following commands to get the current versions of Terraform at the time of this writing, which is 0.12.1
$ cd ~ # 32-bit $ wget https://releases.hashicorp.com/terraform/0.12.1/terraform_0.12.1_linux_386.zip # 64-bit $ wget https://releases.hashicorp.com/terraform/0.12.1/terraform_0.12.1_linux_amd64.zip
02: Unzip the package
$ unzip terraform_0.12.1_linux_amd64.zip
This will extract the Terraform executable in the home directory and will have the path
03: Move or copy the terraform executable to the
directory. Note that this is only a suggestion, technically you can place this in any directory you want.
$ sudo cp terraform /usr/bin
04: Verify that Terraform has been installed
$ terraform --version
Alternative Installation via Snap
Note that this might not be the latest version of Terraform. It is still advisable to use the zipped package from the Terraform website.
$ snap install terraform