How to install Terraform on CentOS 8

Installing Terraform on CentOS 8 : A Step-by-Step Guide:

On this short article we will learn how to install Terraform on CentOS 8 operating system.


Terraform is an open-source infrastructure-as-code (IaC) tool that enables users to define and provision infrastructure resources across various cloud platforms. If we are using CentOS 8 as your operating system and want to leverage the power of Terraform, this article will guide us through the installation process.

Terraform Installation Process

By following these step-by-step instructions, you’ll be ready to start managing our infrastructure with Terraform in no time.

Step 1: Update System Packages

Before installing any software, it’s always a good practice to ensure that your system is up to date. Open a terminal or connect to your CentOS 8 server via SSH and run the following command:

sudo dnf update

This will update all the installed packages to their latest versions.

Step 2: Download the Terraform Binary

Next, we need to download the Terraform binary from the official website. To do this, you can use the wget command. Run the following command to download the latest version of Terraform:


Replace <version> with the desired version number. For example, if you want to download version 1.0.0, the command will be:

$ wget

Output :

ramans@otodiginet ~]$ wget
--2023-06-21 00:04:26--
Resolving (,,, ...
Connecting to (||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20957558 (20M) [application/zip]
Saving to: ‘’ 100%[======================================================>] 19.99M 1.02MB/s in 29s

2023-06-21 00:04:55 (717 KB/s) - ‘’ saved [20957558/20957558]

Step 3: Extract the Terraform Binary

Once the download is complete, we need to extract the Terraform binary from the downloaded ZIP file. Use the following command to extract it:

unzip terraform_<version>

Again, replace <version> with the actual version number you downloaded. For example:

$ sudo unzip

Output :

[ramans@otodiginet ~]$ sudo unzip
inflating: terraform

Step 4: Move the Terraform Binary

After extracting the Terraform binary, we need to move it to a directory that is included in the system’s PATH variable so that it can be executed from anywhere on the system. Run the following command to move the binary:

sudo mv terraform /usr/local/bin/

Output :

[ramans@otodiginet ~]$ sudo mv terraform /usr/local/bin/

This command will move the binary to the /usr/local/bin/ directory.

Step 5: Verify the Installation

To verify that Terraform has been installed successfully, run the following command:

terraform version

If Terraform is installed correctly, we should see the version number displayed in the terminal output.

[ramans@otodiginet ~]$ terraform -v
Terraform v1.5.0
on linux_amd64

Congratulations! We have successfully installed Terraform on CentOS 8. You can now start using Terraform to define and manage your infrastructure resources efficiently.


In this article, we walked through the step-by-step process of installing Terraform on CentOS 8. By following these instructions, you have successfully set up Terraform and can now harness its capabilities to manage your infrastructure as code. Remember to regularly update Terraform to leverage the latest features and bug fixes. Enjoy exploring the possibilities that Terraform offers for automating and scaling your infrastructure!


(Visited 157 times, 1 visits today)


No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *