Simple guide to install TERRAFORM on Linux — LinuxTechLab

Shujat Husain
3 min readSep 1, 2020

--

We have seen a tremendous increase in demand for automation in the IT industry & IaaC, Infrastructure as a Code is a must needed skill to possess. There are a number of tools available for Automation/IaaC & Terraform is one such tool.

Terraform is a great tool for automating our infrastructure by converting all our infrastructure as code. We can deploy resources using only the terraform scripts. The great thing about terraform is that it supports almost all cloud providers like AWS, GCP, Azure, IBM cloud etc & also supports the in-house solutions.

So why do we need to use terraform ?

* With the help of terraform’s configuration file, we can provision a single machine or a complete datacenter. Not only can provision instances, we can also make changes related to networking, DNS, SaaS etc.
* Terraform recognizes incremental changes, so we don’t need to make incremental changes separately, edit the existing configuration file & run the commands. It will identify the incremental changes & will then provision them.
* A single tool can make changes to a number of service providers, so no need to learn cloud formation, Google cloud deployment manager etc.

In this tutorial, we will learn how to install Terraform on Linux systems (Ubuntu, Debian, popOS, CentOS, RHEL, Fedora etc).

Recommended Read: Guide to install Ansible on Ubuntu Also Read: Create your first automation setup: Install Ansible server

Install Terraform

So to install Terraform is pretty simple, we only need to have ‘wget’ installed on our systems to download the terraform package. Download the 64 bit package for Linux using the following command,

$ wget https://releases.hashicorp.com/terraform/0.13.1/terraform_0.13.1_linux_amd64.zip

There are packages available for Windows, Mac, Solaris etc & also 32 bit Linux packages at the HERE https://www.terraform.io/downloads.html .

Once downloaded, unzip & move it to a separate directory,

Now the next thing is to setup the PATH for the terraform folder into our user’s bash profile ( ~/.bash_profile in CentOS/RHEL, ~/.profile in Debian/Ubuntu). To create the PATH entry, open the respective file & make the following entry into the file,

Now save the file & run the following command to implement the changes made to the file,

You can also logout & log back in to implement the changes. That’s it, we now have the terraform command installed & ready to use. To make sure that it is working fine, run the following command,

& we should get the following output,

That’s it for this tutorial on how to install Terraform on Linux machines. In our next tutorials, we will discuss about the commands that are used more frequently with terraform & also how we can create resources using terraform.

If you think we have helped you or just want to support us, please consider these:-

Linux TechLab is thankful for your continued support.

Originally published at https://linuxtechlab.com on September 1, 2020.

--

--

Shujat Husain
Shujat Husain

Written by Shujat Husain

A TechEenthusiat who likes all new technologies & Gaming. Most of all love to write about Cloud & DevOPs & have my own blog as well (https://linuxtechlab.com).

No responses yet