How To Install Terraform on Fedora 43

Managing cloud infrastructure by hand is tedious, error-prone, and simply does not scale. Whether you are spinning up a single virtual machine or orchestrating a multi-cloud environment with dozens of services, doing it manually means wasted time and inevitable mistakes. That is precisely why Terraform exists — and why learning how to install Terraform on Fedora 43 is one of the most valuable skills a DevOps engineer or Linux system administrator can add to their toolkit today.
Terraform, developed by HashiCorp, is an open-source Infrastructure as Code (IaC) tool that lets you define, provision, and manage infrastructure using a simple declarative language called HCL (HashiCorp Configuration Language). It works seamlessly across AWS, Google Cloud, Azure, DigitalOcean, and over 1,000 other providers through a plugin-based architecture.
Fedora 43 is a modern, RPM-based Linux distribution aimed at developers and power users. It ships with dnf5 as its default package manager — a notable change from older Fedora releases that directly affects how you add external repositories. Terraform is not included in Fedora’s default package repositories, so you need to add the HashiCorp repo manually.
In this guide, you will learn three proven installation methods: via the official HashiCorp DNF repository, via manual binary download, and via Snap. You will also learn how to configure Terraform after installation, run your first workflow commands, and resolve the most common errors specific to Fedora 43.
What Is Terraform and Why Does It Matter?
Before jumping into commands, it helps to understand what makes Terraform so widely adopted. At its core, Terraform is a cloud-agnostic infrastructure automation tool. You write configuration files that describe your desired infrastructure state, and Terraform figures out what needs to be created, modified, or destroyed to reach that state.
Its real power lies in reproducibility. Once you write a Terraform configuration, you can deploy the same infrastructure across development, staging, and production environments with zero manual steps. Teams version-control their .tf files in Git, review infrastructure changes in pull requests, and roll back deployments just like application code.
On Fedora 43 specifically, Terraform integrates naturally with the system’s security model, package manager, and shell environment — making it an ideal platform for both local development and server-side automation.
Prerequisites
Before you begin, make sure the following requirements are in place:
- A machine running Fedora 43 (desktop, workstation, or server edition)
- Root access or a user with
sudoprivileges - An active internet connection for downloading packages
- Basic comfort working in the Linux terminal
- The utilities
curl,wget, andunzipavailable on your system - At least 200 MB of free disk space — Terraform’s binary is approximately 57 MB installed
Install the required utilities with:
sudo dnf install curl wget unzip -y
Method 1: Install Terraform via the HashiCorp DNF Repository (Recommended)
This is the official, supported installation method. It integrates Terraform directly into Fedora’s package management system, which means future versions are delivered automatically through standard system updates. It is the approach recommended by HashiCorp for all RPM-based Linux distributions, including Fedora, CentOS, Rocky Linux, and Amazon Linux.
Step 1: Update Your Fedora 43 System
Always begin with a full system update. This ensures your package cache is fresh and prevents dependency conflicts during the Terraform installation.
sudo dnf update -y
This command upgrades all installed packages, including glibc, SSL certificates, and dnf5 itself — all of which can affect how new repository packages are handled.
Step 2: Install DNF Plugins Core
The dnf-plugins-core package provides the config-manager subcommand that you will use in the next step to register the HashiCorp repository.
sudo dnf install -y dnf-plugins-core
Important note for Fedora 43 users: Fedora 43 uses dnf5 by default, which changes the syntax of the config-manager command. The widely referenced --add-repo flag found in older guides and even some official documentation does not work on Fedora 43’s dnf5 and will return an error. Use the updated syntax shown in the next step.
Step 3: Add the Official HashiCorp Repository
Register HashiCorp’s official Fedora package repository using the corrected dnf5 syntax:
sudo dnf config-manager addrepo --from-repofile=https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
This command downloads the .repo file from HashiCorp’s servers and stores it under /etc/yum.repos.d/, making Terraform — and other HashiCorp tools like Vault and Packer — available for installation.
Confirm the repository was registered successfully:
sudo dnf repolist
You should see hashicorp listed as Hashicorp Stable – x86_64 among your active repositories.
Step 4: Install Terraform
With the repository active, installing Terraform is a single command:
sudo dnf install terraform -y
During installation, dnf will display a transaction summary showing the package name, download size (approximately 13 MB), and installed size (approximately 57 MB). The -y flag automatically confirms the prompt so installation proceeds without interruption.
Step 5: Verify the Installation
Confirm Terraform is installed and accessible from any directory:
terraform --version
Expected output:
Terraform v1.13.0
on linux_amd64
You can also run terraform -help to list all available subcommands. If both commands respond without errors, the installation is complete.
Step 6: Keep Terraform Updated Automatically
Because Terraform was installed through the HashiCorp DNF repository, future updates are handled by the standard dnf upgrade command:
sudo dnf upgrade terraform
On servers, you can automate this with dnf-automatic. Regular updates ensure you have the latest security patches, new provider support, and performance improvements.
Method 2: Install Terraform Manually via Binary Download
The manual installation method is ideal when you need to install a specific pinned version of Terraform, work in an air-gapped environment with no internet access to HashiCorp’s servers, or follow strict corporate change-control policies that prohibit third-party repositories.
Step 1: Install Required Utilities
sudo dnf install curl wget unzip -y
Step 2: Detect and Download the Latest Terraform Release
Use curl to dynamically query the GitHub API for the latest stable Terraform release tag, then download the corresponding Linux binary:
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.zip
This approach avoids hardcoding a version number, so you always pull the latest stable release automatically.
Step 3: Extract the Archive
unzip terraform_${TER_VER}_linux_amd64.zip
This extracts a single statically compiled executable named terraform. No additional libraries or dependencies are required.
Step 4: Move the Binary to a System Path
Move the binary to /usr/bin/ so it is accessible system-wide for all user accounts:
sudo mv terraform /usr/bin/
Alternatively, use /usr/local/bin/:
sudo mv terraform /usr/local/bin/
Confirm the binary is in your $PATH:
which terraform
Step 5: Verify the Manual Installation
terraform --version
Expected output:
Terraform v1.x.x
on linux_amd64
Keep in mind that manual installations do not update automatically. To upgrade later, repeat this entire process with the new version.
Method 3: Install Terraform via Snap
For desktop workstations and personal development environments, Snap provides a quick and hassle-free way to get Terraform running on Fedora 43.
Step 1: Install and Enable Snapd
sudo dnf install snapd -y
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
Log out and back in — or restart your shell session — after running these commands for Snap paths to take effect properly.
Step 2: Install Terraform via Snap
sudo snap install terraform --classic
Step 3: Verify
terraform --version
A word of caution: Snap packages run in a sandboxed environment. This can cause slower startup times and occasional path conflicts when Terraform tries to access configuration files outside its sandbox. For production servers and CI/CD pipelines, the DNF repository method remains the stronger choice.
Post-Installation Configuration
Getting Terraform installed is only the first step. A few quick configuration tasks will make your workflow significantly smoother.
Enable shell auto-completion. Terraform supports tab-completion for bash and zsh. Activate it with:
terraform -install-autocomplete
Restart your shell session for the change to take effect. You can now press Tab to autocomplete Terraform commands, resource types, and flags.
Set up a project directory. Organize your Terraform projects from the start:
mkdir ~/terraform-projects && cd ~/terraform-projects
Use environment variables for credentials. Never hardcode cloud provider credentials directly inside .tf files. Instead, export them as environment variables:
export AWS_ACCESS_KEY_ID="your-access-key"
export AWS_SECRET_ACCESS_KEY="your-secret-key"
This is a foundational security practice that prevents accidental credential exposure in version control systems like Git.
Your First Terraform Workflow on Fedora 43
Once Terraform is installed and configured, these five core commands form the backbone of every infrastructure deployment workflow. Start by creating a demo project directory and a basic configuration file:
mkdir ~/terraform-projects/demo && cd ~/terraform-projects/demo
nano main.tf
Inside main.tf, add a minimal AWS provider block:
provider "aws" {
region = "us-east-1"
}
Now run the workflow in sequence:
| Command | Purpose |
|---|---|
terraform init |
Downloads provider plugins and initializes the working directory |
terraform validate |
Checks your configuration files for syntax errors |
terraform plan |
Previews what infrastructure changes Terraform will make |
terraform apply |
Executes the plan and provisions your infrastructure |
terraform destroy |
Tears down all infrastructure managed by this configuration |
Always run terraform plan before terraform apply. It acts as a dry run, showing you exactly what will be created, changed, or destroyed — with no risk of unintended changes to your live infrastructure.
Troubleshooting Common Issues on Fedora 43
Fedora 43’s adoption of dnf5 introduces a few breaking changes compared to older Fedora releases. Here are the most frequent issues and their confirmed solutions.
Issue 1: config-manager addrepo Unrecognized Arguments Error
This error appears when using the old --add-repo syntax on Fedora 43.
Fix: Use the updated dnf5-compatible syntax:
sudo dnf config-manager addrepo --from-repofile=https://rpm.releases.hashicorp.com/fedora/hashicorp.repo
Issue 2: No Match for Argument: terraform
This happens when HashiCorp’s repository does not yet have a build indexed for Fedora 43’s $releasever.
Fix: Override the release version to use the latest available build:
sudo sed -i 's/$releasever/42/g' /etc/yum.repos.d/hashicorp.repo
sudo dnf install terraform -y
Issue 3: terraform: command not found After Manual Installation
This usually means the binary was placed in a directory not included in your $PATH.
Fix: Move the binary to /usr/bin/:
sudo mv terraform /usr/bin/
Or append the correct directory to your shell profile:
export PATH=$PATH:/usr/local/bin
source ~/.bashrc
Issue 4: GPG Signature Verification Failure
If dnf refuses to install the package due to a GPG key error, import HashiCorp’s public signing key manually:
sudo rpm --import https://rpm.releases.hashicorp.com/gpg
Then retry the installation command. The GPG key confirms that packages originate from HashiCorp’s official servers and have not been tampered with.
Congratulations! You have successfully installed Terraform. Thanks for using this tutorial for installing Terraform on your Fedora 43 Linux system. For additional help or useful information, we recommend you check the official Terraform website.