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

Note:- Version 1.0.1 of the Terraform is now available in stable release & can be downloaded from the link HERE. The process for installation is the same as mentioned here.

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.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

‘Wipeout’ contestant dies after completing obstacle course

Earn rewards by leveraging your network: become a DRA

Creating an Ingress Controller with source IP rule on Digital Ocean Kubernetes Cluster

Sign in with Apple: A Zero Code Change Approach

Analysis Paralysis vs Hurry Up and Wait vs Early Pain

How to write better HTML and CSS code

Git and GitHub in a nutshell

Building the right Quality Strategy at a startup with limited resources

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
LinuxTechLab

LinuxTechLab

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.

More from Medium

Vulnerability Scanner/Detector Log4Shell Remote Code Execution Log4j (CVE-2021–44228) — Ansible…

[project]The basics of Docker and K8s

The Linux Commands Series: Part III

How to setup NFS server in 5 minutes on Linux