How to install Terraform on Ubuntu 18


In this article, i will take you through the steps to install terraform on Ubuntu 18. Terraform is an open-source infrastructure as code software tool created by HashiCorp. It enables users to define and provision a datacenter infrastructure using a high-level configuration language known as Hashicorp Configuration Language, or optionally JSON.

Install Terraform on Ubuntu


Before going through the steps to install terraform on ubuntu make sure you have wget and unzip tool installed in your system. If it is not there, use below command to download it from repository.

root@ubuntu:~#apt-get install wget unzip

How to install Terraform on Ubuntu 18 1

Step 1: Update the System

First you need to update the system using apt-get update command.

root@ubuntu:~# apt-get update
Hit:1 bionic InRelease
Hit:2 bionic-updates InRelease
Hit:3 bionic-backports InRelease
Hit:4 bionic InRelease
Hit:5 bionic-security InRelease
Reading package lists... Done

Step 2: Download Terraform Package

Once system is updated, you need to download the latest terraform package using wget.

root@ubuntu:~# wget
--2019-12-09 02:51:22--
Resolving (, 2a04:4e42:25::439
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16494567 (16M) [application/zip]
Saving to: ‘’ 100%[=====================================================================================>] 15.73M 6.85MB/s in 2.3s

2019-12-09 02:51:24 (6.85 MB/s) - ‘’ saved [16494567/16494567]

Step 3: Unzip the File

Once the file is downloaded, unzip the terraform package into /usr/local/bin.

root@ubuntu:~# unzip -d /usr/local/bin/
inflating: /usr/local/bin/terraform

Step 4: Check if it is installed or not

After successfully installing the package, check the Terraform version.

root@ubuntu:/usr/local/bin# terraform -v
Terraform v0.12.17

Congratulations!!!! You have successfully installed Terraform on Ubuntu.


Also Read: How to install Docker on CentOS 7

Reference: Terraform Documentation

Leave a Comment