Simple guide to install TERRAFORM on Linux

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 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 data center. Not only can provision instances, but 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 HERE.

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

$ unzip terraform_0.13.1_linux_amd64.zip
$ mkdir ~/App
$ mv terraform ~/App

Now the next thing is to set up 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,

export PATH
export PATH = “$PATH:~/App”

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

$ source ~/bash_profile

You can also log out & 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,

$ terraform

& 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.

Originally Published at https://linuxtechlab.com/simple-guide-to-install-terraform-on-linux/

We are giving you exclusive deals to try Linux Servers for free with 100$ credit, check these links to claim your 100$,

DigitalOcean — 100$ free credit & Linode — 100$ free credit

Check some Exclusive Deals, HERE.

Also, check out DevOps Book You should read section.

http://linuxtechlab.com is a beginner friendly website where you can learn Linux Tips & tricks,Scripting, also has lots of tutorials aimed at making Linux easy.