This guide will walk you through the steps to install Terraform on Ubuntu / Debian / CentOS / Fedora / Arch Linux system. Terraform is a cloud-agnostic Infrastructure automation tool used to manage cloud and on-premise resources. With it you can build, change, and version infrastructure deployed on popular service providers.
Before downloading terraform we need to install wget and curl tools
# Debian / Ubuntu systems
sudo apt update
sudo apt install wget curl unzip
# RHEL based systems
sudo yum install curl wget unzipHow to Install Terraform on Linux
Terraform is distributed as a tarball on Github. Check the latest release on Terraform releases page before downloading below.
TER_VER=`curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | grep tag_name | cut -d: -f2 | tr -d \"\,\v | awk '{$1=$1};1'`
wget https://releases.hashicorp.com/terraform/${TER_VER}/terraform_${TER_VER}_linux_amd64.zipOnce the archive is downloaded, extract and move terraform binary file to the /usr/local/bin directory.
$ unzip terraform_${TER_VER}_linux_amd64.zip
Archive: terraform_xxx_linux_amd64.zip
inflating: terraform
$ sudo mv terraform /usr/local/bin/This will make the tool accessible to all user accounts.
$ which terraform
/usr/local/bin/terraformCheck the version of Terraform installed
$ terraform --version
Terraform v1.3.7
on linux_amd64To update Terraform on Linux, download the latest release and use the same process to extract and move binary file to location in your PATH.
Learning video courses:
- HashiCorp Certified: Terraform Associate
- Learn DevOps: Infrastructure Automation With Terraform
- HashiCorp Certified: Terraform Associate -50 Practical Demos
- Terraform on AWS with SRE & IaC DevOps | Real-World 20 Demos
Also check:




































































