Free ยท Lesson 2 of 12
Install one version on purpose. A version manager is how a directory can pick a different version without hiding which binary is first on PATH.
Sign in to save your place.
Two rulers in the same pencil case will not measure the same if you grab the wrong one. terraform version is you reading the ruler before you cut.
HashiCorp publishes Terraform packages and a zip you can unpack. OpenTofu publishes its own install instructions and binaries named tofu. Follow the page for the tool you chose. Do not rename tofu to terraform to satisfy an old script. You will forget which one you ran.
Homebrew, apt, and yum repositories exist for HashiCorp. A distribution package can lag. terraform version after install is the check, not the package manager's advertisement.
tfenv and the asdf Terraform plugin install HashiCorp Terraform versions. OpenTofu has its own install paths, including a tofuenv-style manager and asdf plugins. A manager that only knows Terraform will not install OpenTofu, and the reverse is not a promise either.
A .terraform-version file pins Terraform for tfenv in that directory. It does nothing for a teammate who does not use tfenv. Commit a note of the version next to the code, and still run terraform version in CI so the runner proves it.
| Command | Tells you |
|---|---|
| terraform version | The HashiCorp binary on PATH, if that name exists |
| tofu version | The OpenTofu binary on PATH |
| which terraform | The path of the file you are about to run |
Step 1 of 3The shell runs the first matching name. A manager changes what that name points at.
Step 2 of 3terraform and tofu are different files. Similar flags are not a shared identity.
Step 3 of 3Print the version in the directory of the lab before you trust a blog command.
Run the command for the tool you installed. If the command is not found, that is a successful reading of this lesson. Install from the official page, then print the version again.
terraform version
# or, if you chose OpenTofu:
tofu version
which terraform || true
which tofu || true
Checked against the linked documentation in October 2026. A later release can move a flag, a price, or a supported pair. Use the page for the version you installed.