Install and Manage Terraform
Learn how to install Terraform easily and correctly on various operating systems including macOS and Linux. This step-by-step guide will walk you through installing Terraform, manage multiple versions, and verifying the installation — so you’re ready to start managing your infrastructure as code with confidence.
Install Terraform
Install the Terraform CLI with the latest version:
Release Information
Official Release.
All officially supported HashiCorp release channels and their security guarantees.
Install Terraform with Specific Version
To install a specific Terraform version we could use tenv
, so tenv
is a lightweight and versatile Terraform version manager that helps you easily install, switch, and manage multiple Terraform versions on your local machine. With tenv
, you can ensure your projects always use the correct Terraform version without manual downloads or complex configurations. It’s especially useful for teams working on multiple infrastructure-as-code projects that require different Terraform versions.
Install the tenv with the latest version
tenv Usage
tenv <tool> command
tenv <tool> install <version>
tool (alias) | env vars | description |
---|---|---|
tofu (opentofu) | TOFUENV_ | OpenTofu |
tf (terraform) | TFENV_ | Terraform |
tg (Terragrunt) | TG_ | Terragrunt |
at (atmos) | ATMOS_ | Atmos |
Install Terraform with tenv
Install Terraform with version 1.11.4
tenv tf install 1.11.4
Install Another Version of Terraform with tenv
Install Terraform with version 1.10.5
tenv tf install 1.10.5
Manage Multiple Terraform Versions
Now, we have multiple version of Terraform installed in our local (1.11.4
and 1.10.5
). To see a list of installed versions:
$ tenv tf list
1.10.5 (used 2025-04-15)
* 1.11.4 (used 2025-04-15, set by /Users/ardityo.mulawarman/.tenv/Terraform/version)
To use specific version, we could just simply select it:
$ tenv tf use 1.10.5
Written 1.10.5 in /Users/ardityo.mulawarman/.tenv/Terraform/version
Validate Terraform Version
$ terraform version
Terraform v1.10.5
on darwin_arm64
Your version of Terraform is out of date! The latest version
is 1.11.3. You can update by downloading from https://www.terraform.io/downloads.html