Install Terraform

This pages shows you different ways to install Terraform.

Install via tfenv

The recommended way to install terraform is with tfenv. This allows you to choose and switch versions of Terraform easily. Here are the commands:

git clone https://github.com/tfutils/tfenv.git ~/.tfenv
echo 'export PATH="$HOME/.tfenv/bin:$PATH"' >> ~/.bash_profile
export PATH="$HOME/.tfenv/bin:$PATH"
tfenv install 1.5.5 # do not use later than 1.5.5
tfenv use 1.5.5

Install via Terraform Download

The Terraform installation instructions provide steps to download and install terraform for your system.

Terraform BSL License Change

The Terraform BSL license announcement on August 10, 2023 restricts usage of future terraform versions from being used with offerings Hashicorp deems competitive to their own solutions. Here’s the Terraform license. Terraform 1.5.5 and below are unaffected.

To address this, Terraspace errs on the side of prudence.

  1. We’re telling users to use OpenTofu fork of Terraform.
  2. If you’re using Terraform, we recommend using Terraform 1.5.5 and below with Terraspace.
  3. The Terraspace framework CLI checks on the client side and only allows Terraform 1.5.5 and below usage by default. You can bypass the check if your usage is acceptable with the BSL license, but you must explicitly do so.
  4. For Terraspace Cloud, you cannot use newer Terraform versions. Whether or not you bypass the check, Terraspace Cloud does not allow the use of any Terraform versions greater than 1.5.5. The API denies requests with the Hashicorp terraform binary and prevent data from saving on the Cloud backend side entirely. Terraform forks with a more permissive license are allowed.

You have full control over the Terraform installation since terraspace and terraform run entirely from your machine. It’s just a matter of installing the Terraform version that Hashicorp considers acceptable for your use case.

We recomend using the OpenTofu fork.

Generally, Terraspace will develop and test with OpenTofu. Though, we would like to keep Terraspace and HashiCorp’s Terraform working also for the folks on it and within the BSL license usage terms.

If you are within acceptable usage, you can bypass the check with TS_VERSION_CHECK=0.

Checking Terraform Version

You can check if you have a permitted terraform version with:

$ terraspace check
terraspace version: 2.2.11
terraform bin: ~/.tfenv/bin/terraform
terraform version: 1.5.5
You're all set!

More tools: