> ## Documentation Index
> Fetch the complete documentation index at: https://docs.streamkap.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Installing Terraform

> How to install Terraform on macOS, Windows, and Linux using popular package managers.

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 theme={null}
# 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`
</Tip>

### MacPorts

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

```bash theme={null}
sudo port install terraform

# Verify installation
terraform --version
```

## Windows

### Chocolatey (Recommended)

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

```powershell theme={null}
# 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 theme={null}
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 theme={null}
# 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 theme={null}
# 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

<AccordionGroup>
  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>

  <Accordion title="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.
  </Accordion>
</AccordionGroup>
