Intro

Terraform is an infrastructure as code tool from the wonderful people at Hashicorp. Terraform makes it really enjoyable to manage infrastructure on platforms such as AWS, Azure, VMware vSphere and OpenStack among many others . This short post will run through installing Terraform on Ubuntu 1804.

Download

Terraform is distributed as a standalone binary which can be downloaded for the target system here . The latest release at the time of writing is 0.11.10 .

Download and unzip Terraform.

cmd
cd ~/Downloads/
wget https://releases.hashicorp.com/terraform/0.11.10/terraform_0.11.10_linux_amd64.zip
unzip terraform_0.11.10_linux_amd64.zip

Create a directory for the Terraform binary. I like to keep standalone applications in the /opt directory.

cmd
sudo mkdir /opt/terraform
sudo mv terraform /opt/terraform/

Symlink the Terraform binary to a location that is in your $PATH . I will use the /usr/local/bin/ directory.

cmd
sudo ln -s /opt/terraform/terraform /usr/local/bin/

Now you will have access to the terraform cli command.

cmd
terraform --version

# output

Terraform v0.11.10

Outro

Terraform is a great application for managing your infrastructure as code. Now you know how to install it, checkout the docs for usage examples and go out and build something awesome.