Terraform is a cloud-agnostic Infrastructure automation tool created by the awesome HashiCorp Engineers to help you with the infrastructure resource management using code. Terraform allows you build, change, and version infrastructure deployed on popular cloud environments and on premise . This short article will show you how to install terraform on CentOS 8 / Rocky Linux 8 Linux system.
Install Terraform on CentOS 8 / Rocky Linux 8
Before you get started ensure you have a sudo user that will be used to install Terraform on CentOS 8 / Rocky Linux 8 Linux machine. Below few steps should work fine for you.
Step 1: Install yum-utils package
We’ll use yum-utils package that will help in adding HashiCorp repository to the system:
sudo yum install -y yum-utils
Step 2: Install Terraform on CentOS 8 / Rocky Linux 8
Next we add CentOS YUM repository:
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
Confirm repository is added and working:
$ sudo dnf repolist repo id repo name appstream CentOS Stream 8 - AppStream baseos CentOS Stream 8 - BaseOS centos-advanced-virtualization CentOS-8 - Advanced Virtualization centos-ceph-nautilus CentOS-8 - Ceph Nautilus centos-nfv-openvswitch CentOS-8 - NFV OpenvSwitch centos-openstack-wallaby CentOS-8 - OpenStack wallaby centos-rabbitmq-38 CentOS-8 - RabbitMQ 38 epel Extra Packages for Enterprise Linux 8 - x86_64 epel-modular Extra Packages for Enterprise Linux Modular 8 - x86_64 extras CentOS Stream 8 - Extras hashicorp Hashicorp Stable - x86_64 powertools CentOS Stream 8 - PowerTools
If you can see hashicorp from the list proceed to install terraform:
sudo yum -y install terraform
Step 3: Confirm Terraform Installation on CentOS 8 / Rocky Linux 8
Check the version of Terraform to validate our installation:
$ terraform version Terraform v1.0.0 on linux_amd64
You can then refer to some of the guides we have on using Terraform.
Other Learning materials include: