Skip to main content
📬 Get weekly Production AI insights Practical notes on Kubernetes, AI infrastructure and platform engineering. No spam. Subscribe free
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.

Luca Berton

· AI Advisor & Architect

Published · 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.

Free 30-min Production AI consultation

Book Now