---
title: "Installing Terraform"
description: "Install the Terraform CLI on macOS with Homebrew or MacPorts, on Windows with Chocolatey or Scoop, and on Linux with APT or DNF."
---

Before using the Streamkap Terraform Provider, you need to install the Terraform CLI on your machine.

## macOS

### Homebrew (Recommended)

[Homebrew](https://brew.sh/) is the most popular package manager for macOS.

```bash
# Add the HashiCorp tap
brew tap hashicorp/tap

# Install Terraform
brew install hashicorp/tap/terraform

# Verify installation
terraform --version
```

:::tip
To upgrade Terraform later, run `brew upgrade hashicorp/tap/terraform`
:::

### MacPorts

If you use [MacPorts](https://www.macports.org/), Terraform is available in the ports collection:

```bash
sudo port install terraform

# Verify installation
terraform --version
```

## Windows

### Chocolatey (Recommended)

[Chocolatey](https://chocolatey.org/) is a popular package manager for Windows.

```powershell
# Run in an elevated PowerShell prompt (Run as Administrator)
choco install terraform

# Verify installation
terraform --version
```

### Scoop

[Scoop](https://scoop.sh/) is another package manager for Windows:

```powershell
scoop install terraform

# Verify installation
terraform --version
```

### Manual Installation

1. Download the appropriate package from the [Terraform downloads page](https://developer.hashicorp.com/terraform/downloads)
2. Extract the zip archive
3. Move `terraform.exe` to a directory in your system PATH (e.g., `C:\Windows\System32` or create a dedicated directory)
4. Open a new command prompt and verify: `terraform --version`

## Linux

### Ubuntu/Debian (APT)

```bash
# Add HashiCorp GPG key
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg

# Add the official HashiCorp repository
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list

# Update and install
sudo apt update && sudo apt install terraform

# Verify installation
terraform --version
```

### RHEL/CentOS/Fedora (DNF/YUM)

```bash
# Add HashiCorp repository
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

# Install Terraform
sudo dnf install terraform

# Verify installation
terraform --version
```

## Troubleshooting

**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**

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**

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.
