Installing Terraform

Arch Linux

Installing terraform on Arch Linux variants is pretty straightforward. Its available here and supported in their standard repository.

$ sudo pacman -Sy terraform

You can test that worked with:

[andy@home-pc ~]$ terraform -v
Terraform v0.11.13

CentOS 7

Unfortunately the situation is not quite as straightforward for Ubuntu or CentOS installations. If you’re a Private Terraform Enterprise customer, you may want to check this guide out. For the rest of us, we need to manually download and install.

First install a couple of useful packages:

$ sudo yum install jq wget unzip -y

With these two packages installed, you can download the latest package with:

$ wget $(echo "$(curl -s | jq -r -M '.current_version')/terraform_$(curl -s | jq -r -M '.current_version')")

Unzip the package and move it to your local bin directory.

$ unzip
$ sudo mv -v terraform /usr/local/bin/

Test that worked with:

[andy@terra ~]$ terraform -version
Terraform v0.11.13


Installing Terraform on Ubuntu is actually the same process as that of CentOS; it must be manually installed. First install some required packages like unzip and jq.

andy@ubuntu16:~$ sudo apt install unzip -y

Download the latest package with:

andy@ubuntu16:~$ wget $(echo "$(curl -s | jq -r -M '.current_version')/terraform_$(curl -s | jq -r -M '.current_version')")

Then unzip and move the binary to /usr/local/bin.

andy@ubuntu16:~$ unzip
andy@ubuntu16:~$ sudo mv -v terraform /usr/local/bin/

Again, test that worked with:

andy@ubuntu16:~$ terraform -v
Terraform v0.11.14

Be the first to comment

Leave a Reply