> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Install and manage local ClickHouse versions using clickhousectl, the ClickHouse CLI

# Install with the ClickHouse CLI

<Info>
  **Windows users**

  ClickHouse runs natively on Linux and macOS. On Windows, run these steps inside
  the [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/about).
</Info>

The ClickHouse CLI (`clickhousectl`) helps you install and manage local ClickHouse
versions, launch servers, and run queries.

<Steps>
  <Step>
    <h2 id="install-the-cli">
      Install the ClickHouse CLI
    </h2>

    ```bash theme={null}
    curl https://clickhouse.com/cli | sh
    ```

    A `chctl` alias is also created automatically for convenience.
  </Step>

  <Step>
    <h2 id="cli-install-clickhouse">
      Install ClickHouse
    </h2>

    Install the latest version of ClickHouse and make it your default:

    ```bash theme={null}
    clickhousectl local use latest
    ```

    `local use` installs the version if it isn't already present, sets it as your
    default, and creates a `clickhouse` symlink in `~/.local/bin` (on your `PATH`)
    so you can invoke the `clickhouse` binary directly. Any later step in these docs
    that runs a `clickhouse` command then works as-is.

    You can also select a specific version:

    ```bash theme={null}
    clickhousectl local use 26.5            # Latest 26.5.x.x
    clickhousectl local use 26.5.2.39       # Exact version
    ```

    <Info>
      **Use vs install**

      `clickhousectl local use <version>` installs a version *and* makes it your
      default, updating the `clickhouse` symlink on your `PATH`. To download a version
      without changing your default or updating the symlink, use
      `clickhousectl local install <version>` instead.
    </Info>
  </Step>

  <Step>
    <h2 id="cli-start-clickhouse-server">
      Start clickhouse-server
    </h2>

    ```bash theme={null}
    clickhousectl local server start
    ```

    The server runs in the background. To verify it's running:

    ```bash theme={null}
    clickhousectl local server list
    ```
  </Step>

  <Step>
    <h2 id="cli-start-clickhouse-client">
      Start clickhouse-client
    </h2>

    ```bash theme={null}
    clickhousectl local client
    ```

    You will see something like this:

    ```response theme={null}
    ClickHouse client version 24.5.1.117 (official build).
    Connecting to localhost:9000 as user default.
    Connected to ClickHouse server version 24.5.1.

    local-host :)
    ```

    You're now ready to start sending SQL commands to ClickHouse!

    <Tip>
      The [Quick Start](/get-started/setup/install) walks you through the steps for creating tables and inserting data.
    </Tip>
  </Step>
</Steps>
