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

# ClickHouse Setup

> Set up ClickHouse as Tell's analytics storage backend.

Tell uses ClickHouse for analytics storage — events, logs, sessions, and query results all live here. You need a running ClickHouse instance before Tell can store data.

## Pick a provider

<CardGroup cols={3}>
  <Card title="Self-hosted" icon="server" href="#self-hosted">
    Run ClickHouse on your own infrastructure.
  </Card>

  <Card title="ClickHouse Cloud" icon="cloud" href="https://clickhouse.com/cloud">
    Managed service from the ClickHouse team.
  </Card>

  <Card title="Tinybird" icon="bolt" href="https://www.tinybird.co">
    Managed ClickHouse with a real-time data platform.
  </Card>
</CardGroup>

## Self-hosted

<Steps>
  <Step title="Install ClickHouse">
    ```bash theme={null}
    curl https://clickhouse.com/ | sh
    ```
  </Step>

  <Step title="Start the server">
    ```bash theme={null}
    ./clickhouse server
    ```
  </Step>

  <Step title="Initialize Tell tables">
    ```bash theme={null}
    tell clickhouse init myproject
    ```

    This creates:

    * A database and all required tables
    * A ClickHouse user with the right permissions
    * A config file at `configs/myproject.toml` with generated credentials
  </Step>

  <Step title="Start Tell">
    ```bash theme={null}
    tell run -c configs/myproject.toml
    ```
  </Step>
</Steps>

## Using a managed provider

For ClickHouse Cloud or Tinybird, you'll need the connection details from your provider. Pass them to the init command:

```bash theme={null}
tell clickhouse init myproject --host your-instance.clickhouse.cloud --port 9440 --secure
```

The generated config will include your connection details.
