> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/data-sources-and-connectors/connectors/clickhouse.md).

# ClickHouse

Connect RootCause to ClickHouse to import tables or query them directly. The connector speaks ClickHouse's HTTP interface.

***

### Prerequisites

* Hostname and the HTTP interface port: 8123 by default, 8443 with SSL. This is not the native TCP port 9000.
* Database name (default `default`) and a user with read access
* Network access from RootCause to the HTTP port

***

### Setting up the connection

1. In the Import Manager, click the **ClickHouse** card
2. Enter your connection details:

| Field               | Description                               | Example          |
| ------------------- | ----------------------------------------- | ---------------- |
| Host                | Server hostname or IP                     | `ch.example.com` |
| HTTP Port           | HTTP interface port (8443 with SSL)       | `8123`           |
| Database            | Database name                             | `default`        |
| Username / Password | ClickHouse user; both are required        | `default`        |
| Enable SSL          | Encrypted connection; pair with port 8443 | On               |

3. Click **Test connection** to verify, then **Save & continue**

***

### Importing data

**Tables**: browse databases and tables. **Custom Query**: any SELECT, useful for sampling or pre-aggregating very large tables before import.

***

### Import modes

Full Import, Full Import + Live, Recent Rows, Time Period and Query Directly. Rolling windows are resolved by ClickHouse itself. See [Connectors](/data-sources-and-connectors/connectors.md).

***

### Troubleshooting

**Connection refused**

* You are probably pointing at the native port 9000; use the HTTP port 8123 (or 8443 with SSL)

**Authentication failed**

* Check user and password; ClickHouse Cloud requires SSL on 8443

**Timeout on huge tables**

* Import a pre-aggregated custom query, use a rolling window, or Query Directly
