# Installation {#installation}

The connection program, `takumigateway`, is distributed as a single static binary. It supports Linux (amd64, arm64), macOS (arm64), and Windows (amd64, arm64). Download the one for your platform and make it executable.

The commands below resolve the newest published version from [https://dist.takumi-san.ai/gateway/latest/VERSION](https://dist.takumi-san.ai/gateway/latest/VERSION) and download it into a `takumi-gateway` folder in your home directory. Replace that lookup with a version number to pin one.

<Tabs>
<TabItem value="linux-amd64" label="Linux (amd64)" default>

```sh
GATEWAY_VERSION=$(curl -fsSL https://dist.takumi-san.ai/gateway/latest/VERSION)
GATEWAY_URL="https://dist.takumi-san.ai/gateway/${GATEWAY_VERSION}/linux/amd64/takumigateway"
mkdir -p "$HOME/takumi-gateway" && cd "$HOME/takumi-gateway"
curl -fL "$GATEWAY_URL" -o takumigateway
chmod +x takumigateway
```

</TabItem>

<TabItem value="linux-arm64" label="Linux (arm64)">

```sh
GATEWAY_VERSION=$(curl -fsSL https://dist.takumi-san.ai/gateway/latest/VERSION)
GATEWAY_URL="https://dist.takumi-san.ai/gateway/${GATEWAY_VERSION}/linux/arm64/takumigateway"
mkdir -p "$HOME/takumi-gateway" && cd "$HOME/takumi-gateway"
curl -fL "$GATEWAY_URL" -o takumigateway
chmod +x takumigateway
```

</TabItem>

<TabItem value="macos-arm64" label="macOS (arm64)">

```sh
GATEWAY_VERSION=$(curl -fsSL https://dist.takumi-san.ai/gateway/latest/VERSION)
GATEWAY_URL="https://dist.takumi-san.ai/gateway/${GATEWAY_VERSION}/darwin/arm64/takumigateway"
mkdir -p "$HOME/takumi-gateway" && cd "$HOME/takumi-gateway"
curl -fL "$GATEWAY_URL" -o takumigateway
chmod +x takumigateway
```

</TabItem>

<TabItem value="windows-amd64" label="Windows (amd64)">

```powershell
$GatewayDir = Join-Path $HOME 'takumi-gateway'
New-Item -ItemType Directory -Force -Path $GatewayDir | Out-Null
Set-Location $GatewayDir
$Version = (Invoke-RestMethod https://dist.takumi-san.ai/gateway/latest/VERSION).Trim()
Invoke-WebRequest -Uri "https://dist.takumi-san.ai/gateway/$Version/windows/amd64/takumigateway.exe" -OutFile "takumigateway.exe"
```

</TabItem>

<TabItem value="windows-arm64" label="Windows (arm64)">

```powershell
$GatewayDir = Join-Path $HOME 'takumi-gateway'
New-Item -ItemType Directory -Force -Path $GatewayDir | Out-Null
Set-Location $GatewayDir
$Version = (Invoke-RestMethod https://dist.takumi-san.ai/gateway/latest/VERSION).Trim()
Invoke-WebRequest -Uri "https://dist.takumi-san.ai/gateway/$Version/windows/arm64/takumigateway.exe" -OutFile "takumigateway.exe"
```

</TabItem>
</Tabs>

## Verify the Binary {#verify}

The connection program runs commands on the machine you install it on. Before running it, make sure your download has not been tampered with. The hashes for each version are published at `https://dist.takumi-san.ai/gateway/<version>/SHA256SUMS`.

Compute the hash of your download with the command below, and check that it matches the line in `SHA256SUMS` for your OS and architecture.

| OS                   | Command                                                     |
| -------------------- | ----------------------------------------------------------- |
| Linux                | `sha256sum ./takumigateway`                                 |
| macOS                | `shasum -a 256 ./takumigateway`                             |
| Windows (PowerShell) | `(Get-FileHash .\takumigateway.exe -Algorithm SHA256).Hash` |

Check which version you installed:

```sh
# Linux / macOS
./takumigateway --version

# Windows (PowerShell)
.\takumigateway.exe --version
```

## Automatic Updates {#updates}

On startup, the connection program checks for a newer release, verifies its signed release information, and installs the update before connecting. If a newer release appears while it is running, it displays a notice and installs the update the next time it starts. If the update check is unavailable, the installed version continues running.

:::warning
To update itself, the connection program must be installed in a directory that the user running it can write to. It cannot update a copy installed in a directory that requires administrator privileges.
:::

## Next Steps {#next-steps}

Follow [Start an Assumed-Breach Test](/docs/t/assessment/features/pentest/gateway/quickstart.md) to register a gateway and connect it to Takumi.
