macOS
Homebrew (Recommended)
Homebrew is the most popular package manager for macOS.MacPorts
If you use MacPorts, Terraform is available in the ports collection:Windows
Chocolatey (Recommended)
Chocolatey is a popular package manager for Windows.Scoop
Scoop is another package manager for Windows:Manual Installation
- Download the appropriate package from the Terraform downloads page
- Extract the zip archive
- Move
terraform.exeto a directory in your system PATH (e.g.,C:\Windows\System32or create a dedicated directory) - Open a new command prompt and verify:
terraform --version
Linux
Ubuntu/Debian (APT)
RHEL/CentOS/Fedora (DNF/YUM)
Troubleshooting
Command not found after installation
Command not found after installation
Ensure the Terraform binary is in your system
PATH. You may need to restart your terminal or shell session after installation.Permission denied errors on macOS/Linux
Permission denied errors on macOS/Linux
If you encounter permission errors, ensure you’re using
sudo where required, or check that your user has write access to the installation directory.Version mismatch or old version
Version mismatch or old version
If you have an older version installed via a different method, uninstall it first before using a package manager. For Homebrew:
brew unlink terraform before installing the HashiCorp tap version.