How to install Terraform in Ubuntu

How to install Terraform in Ubuntu

How to install terraform
Image by terraform.io
Hashicorp Terraform is popular open source Infrastructure as Code tool for automating infrastructure, You can install and configure your cloud infrastructure using terraform, Terraform is very popular today for devops terms, In this post I will explain how to install and configure terraform in Ubuntu.

Install Terraform 

Let’s install Terraform in Ubuntu server using command line.


Install the Curl, gnupg and software-properties-common packages.

sudo apt-get update && sudo apt-get install -y gnupg software-properties-common


Install GPG key from Hashicorp.


wget -O- https://apt.releases.hashicorp.com/gpg | \
    gpg --dearmor | \
    sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg


 

Verify Key Fingerptint.


gpg --no-default-keyring \
    --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
    --fingerprint



You will get the key fingerprint.




Now, let’s add Hashicorp repository to our server.


echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
    https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
    sudo tee /etc/apt/sources.list.d/hashicorp.list



Download the package information from Hashicorp using this command.


sudo apt update



Run below command to install terraform.


sudo apt-get install terraform



Verify the terraform installation.


terraform -help



Hope you like the article, I will post more article on terraform.


Linux Guru

Welcome to my Linux blog! Hello Friends, I am Vishal Vyas. I am a DevOps engineer and expert in Linux and Cloud Computing. Also I am a Certified Kubernetes Administrator, I have a total 12 plus years of experience in the IT field and I have worked in various technologies. I write about Linux, AWS, DevOps and web Technologies, I have started this blog to share my technical knowledge with all, I am posting here what I learn from the latest web technologies and the likes.

Post a Comment

If you have any doubts, Please let me know

Previous Post Next Post