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

# Download Self-Hosted CLI

> Install cpctl, the Chainstack Self-Hosted command-line tool, on Linux, macOS, or Windows using the Chainstack bootstrap script for setup.

**`cpctl`** is the command-line tool for installing and upgrading Chainstack Self-Hosted. This page covers getting it onto your local machine.

<Info>
  Installing `cpctl` only puts it on your machine. It does not deploy the Control Panel itself — for that, see [Installation](/docs/self-hosted/installation).
</Info>

To install `cpctl`, run the script for your operating system:

<Tabs>
  <Tab title="Linux / macOS">
    ```bash theme={"system"}
    curl -sSL https://install.chainstack.com/cpctl.sh | sh
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell theme={"system"}
    irm https://install.chainstack.com/cpctl.ps1 | iex
    ```
  </Tab>
</Tabs>

This downloads and runs the `cpctl` installer script, which sets up the Chainstack Self-Hosted command-line tool on your system.

## Supported platforms

The installer automatically detects your operating system and architecture.

| Operating system | Architectures                    |
| ---------------- | -------------------------------- |
| Linux            | amd64 (x86\_64), arm64 (aarch64) |
| macOS            | amd64 (x86\_64), arm64 (aarch64) |
| Windows          | amd64 (x86\_64), arm64           |

<Note>
  32-bit systems (x86, ARM) are not supported.
</Note>

## Install a specific version

<Tabs>
  <Tab title="Linux / macOS">
    Pass the version as an argument:

    ```bash theme={"system"}
    curl -sSL https://install.chainstack.com/cpctl.sh | sh -s v1.8.0
    ```

    Or set the `CPCTL_VERSION` environment variable:

    ```bash theme={"system"}
    CPCTL_VERSION=v1.8.0 curl -sSL https://install.chainstack.com/cpctl.sh | sh
    ```
  </Tab>

  <Tab title="Windows">
    ```powershell theme={"system"}
    iwr https://install.chainstack.com/cpctl.ps1 -OutFile cpctl.ps1
    .\cpctl.ps1 -Version v1.8.0
    ```

    Or set the `CPCTL_VERSION` environment variable:

    ```powershell theme={"system"}
    $env:CPCTL_VERSION = "v1.8.0"
    irm https://install.chainstack.com/cpctl.ps1 | iex
    ```
  </Tab>
</Tabs>

## Custom install directory

<Tabs>
  <Tab title="Linux / macOS">
    By default, `cpctl` installs to `/usr/local/bin/`. To override the install directory, set the `CPCTL_INSTALL_DIR` environment variable:

    ```bash theme={"system"}
    CPCTL_INSTALL_DIR=/opt/bin curl -sSL https://install.chainstack.com/cpctl.sh | sh
    ```
  </Tab>

  <Tab title="Windows">
    By default, `cpctl` installs to `%LOCALAPPDATA%\cpctl\` and is automatically added to the user `PATH`.
  </Tab>
</Tabs>

<Note>
  Make sure your server meets the [system requirements](/docs/self-hosted/requirements) before running the installer.
</Note>

## Verify the cpctl binary

After the installer completes, confirm that `cpctl` is available and check its version:

```bash theme={"system"}
cpctl version
```

## Shell completion

`cpctl` can generate shell completion scripts for bash, zsh, fish, and PowerShell.

<Tabs>
  <Tab title="bash">
    Load completions for the current session:

    ```bash theme={"system"}
    source <(cpctl completion bash)
    ```

    Load for every new session:

    ```bash theme={"system"}
    # Linux
    cpctl completion bash > /etc/bash_completion.d/cpctl

    # macOS
    cpctl completion bash > $(brew --prefix)/etc/bash_completion.d/cpctl
    ```
  </Tab>

  <Tab title="zsh">
    Load completions for the current session:

    ```zsh theme={"system"}
    source <(cpctl completion zsh)
    ```

    Load for every new session:

    ```zsh theme={"system"}
    cpctl completion zsh > "${fpath[1]}/_cpctl"
    ```
  </Tab>

  <Tab title="fish">
    Load completions for the current session:

    ```fish theme={"system"}
    cpctl completion fish | source
    ```

    Load for every new session:

    ```fish theme={"system"}
    cpctl completion fish > ~/.config/fish/completions/cpctl.fish
    ```
  </Tab>

  <Tab title="PowerShell">
    Load completions for the current session:

    ```powershell theme={"system"}
    cpctl completion powershell | Out-String | Invoke-Expression
    ```

    To persist, add that line to your PowerShell profile (`$PROFILE`).
  </Tab>
</Tabs>

## Next steps

With `cpctl` on your machine, you're ready to set up the cluster and deploy the Control Panel:

1. [Environment setup](/docs/self-hosted/environment-setup) — Set up your Kubernetes cluster and required tools, if not already done
2. [Installation](/docs/self-hosted/installation) — Deploy the Control Panel using `cpctl install`
3. [Quick start](/docs/self-hosted/quick-start) — End-to-end walkthrough from a fresh server
