Home / How To / How to install Terraform on Ubuntu 18.04 LTS

How to install Terraform on Ubuntu 18.04 LTS

Terraform is an automated open source infrastructure tool created by HashiCorp. It is written in the Go programming language. It allows you to define and describe your infrastructure as code in configuration files with a declarative language and to distribute and manage that infrastructure in various public cloud providers such as AWS, GCP, Azure, etc.

The basic workflow when using Terraform is: [1

9659003] first Write configuration files on your computer where you declare the parts of your infrastructure that you want to create.
2. Ask Terraform to analyze your configurations and then create the corresponding infrastructure.

This tutorial explains how to install Terraform on Ubuntu 18.04.

Install Terraform

Terraform is very easy to install. You can download Terraform from Terraform download page . Choose the appropriate package for your operating system and architecture, unzip the archive and move the binary to a directory that is part of your PATH variable.

First create ~ / bin directory:

  mkdir ~ / bin 

On Ubuntu, if you create this directory it is automatically added to your PATH.

Then download the zip archive. Visit the Terraform download page for the latest version to download.

  wget https://releases.hashicorp.com/terraform/0.12.24/terraform_0.12.24_linux_amd64.zipebrit19659009??Unzip archive. The archive will extract a single binary called  terraform . 

  unzip terraform_0.12.24_linux_amd64.zip 

Move terraform binary to a directory included in the system's PATH in our case it is ~ / bin directory.

  etc. terraform ~ / bin 

To check if Terraform is installed, run:

   terraform version 
# Terraform v0.12.24

The best place to learn how to use Terraform, distribute and manage your infrastructure is Terraform docs. There are many suppliers you can handle with it.

Source link