Install Terraform on Ubuntu 23.04

 Terraform, a powerful tool developed by HashiCorp, has revolutionized infrastructure management and deployment through its declarative coding framework. It provides a systematic approach to managing and provisioning cloud resources, making infrastructure changes more predictable and manageable.

 

Whether you are a seasoned system administrator or just a beginner in the world of cloud computing and infrastructure management, this guide will equip you with all you need to get Terraform up and running on Ubuntu 23.04.

 

We will begin by preparing your Ubuntu system, proceeding to download and install Terraform, and finally, we will verify that the installation is successful. We understand that installation processes can sometimes be challenging, so we have made every effort to break down the steps into easy-to-follow instructions.

 

Since installation steps from official terraform installation doesn’t seem to work I hope you will find it usefull. 


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

Next we need to import Hashicorp GPG key to trusted keys:

curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/hashicorp.gpg --import

Give proper permissions to the key:

sudo chmod 644 /etc/apt/trusted.gpg.d/hashicorp.gpg

Finally you can add repository so apt will be able look for packages 

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

And finally you can install Terraform

sudo apt update && sudo apt install terraform

Adrian Jutrowski

Software Developer