Skip to main content
🎓 Claude Code Masterclass Learn AI-assisted development on Udemy — plus the companion book on Leanpub & Amazon. Start Learning
Install Terraform on RHEL 9
DevOps

Install Terraform on RHEL 9: Complete Guide (2026)

Install Terraform on RHEL 9 in 2026. Official repository setup, package installation, post-install configuration, and troubleshooting.

LB
Luca Berton
· 1 min read

Here is how to install Terraform on RHEL 9. Tested and verified.

Prerequisites

  • RHEL 9 installed and updated
  • Root or sudo access
  • Internet connection

Step 1: Update System

sudo dnf update -y

Step 2: Add Official Repository

Terraform is distributed through HashiCorp’s official dnf/yum repository. Install the config-manager plugin, then register the repository before installing:

# Install the dnf config-manager plugin
sudo dnf install -y dnf-plugins-core

# Add the official HashiCorp repository for RHEL
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

# Refresh the package metadata cache
sudo dnf makecache

Step 3: Install Terraform

sudo dnf install -y terraform

Step 4: Verify Installation

terraform version

Expected output should show the installed version, for example Terraform v1.x.x.

Step 5: Enable Shell Autocomplete

Terraform is a CLI binary with no background service, so there is nothing to enable or start with systemd. Instead, enable tab-completion for your shell:

terraform -install-autocomplete

This appends the completion hook to your shell profile (~/.bashrc for Bash). Restart your shell or run source ~/.bashrc for it to take effect.

Troubleshooting

GPG Key or Signature Errors

If dnf reports a GPG check failure when installing, import the HashiCorp signing key manually and retry:

sudo rpm --import https://rpm.releases.hashicorp.com/gpg
sudo dnf clean all && sudo dnf makecache

Package Not Found

Confirm the repository was registered and the metadata cache is current:

cat /etc/yum.repos.d/hashicorp.repo
sudo dnf clean all && sudo dnf makecache
dnf list terraform

If dnf list terraform returns “Error: No matching Packages to list”, the dnf config-manager --add-repo step did not complete — repeat Step 2. Note that HashiCorp’s dnf/yum repository publishes x86_64 packages only; on aarch64 RHEL installs, dnf install terraform will report no match because there is no official ARM RPM build.

Uninstall

sudo dnf remove -y terraform

About the Author

I am Luca Berton, AI and Cloud Advisor. Book a consultation to get help with your infrastructure setup.

#Terraform #RHEL 9 #Installation #Linux #DevOps
Share:
Ansible & Python Training

Need help with Ansible & Python Training?

Level up your automation skills with expert-led Ansible and Python training.

Learn more about Ansible & Python Training

Want to operate this yourself, in production?

Take the free AI Platform Engineer Readiness Scorecard to see which skills transfer — then build a production-shaped AI platform in the 4-week Bootcamp.

Take the Scorecard →
Luca Berton — The Production AI Expert, Docker Captain

Luca Berton

The Production AI Expert · Docker Captain · KubeCon Speaker

15+ years in enterprise infrastructure. Author of 8 technical books, creator of Ansible Pilot (1M+ YouTube views, 648K site users). Former Red Hat engineer. Speaker at KubeCon EU 2026 and Red Hat Summit 2026.

Free 30-min Production AI consultation

Book Now