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

# ClickHouse

> Connect Mora to a ClickHouse instance via its HTTP interface.

## Prerequisites

* A ClickHouse server with the HTTP interface enabled (typically port 8443 for TLS or 8123 for plaintext).
* A user with read access to the target database.

## Required fields

| Field        | Description                                       | Example                                       |
| ------------ | ------------------------------------------------- | --------------------------------------------- |
| **Name**     | A display name for this datasource.               | `Mora warehouse`                              |
| **URL**      | The full HTTP(S) URL of your ClickHouse instance. | `https://your-instance.clickhouse.cloud:8443` |
| **Username** | The ClickHouse user.                              | `default`                                     |
| **Password** | The user's password.                              |                                               |

## Optional fields

| Field        | Description                                                                                            | Example   |
| ------------ | ------------------------------------------------------------------------------------------------------ | --------- |
| **Database** | The default database to query. If omitted, ClickHouse uses its configured default (usually `default`). | `default` |

## Steps

1. Open **Settings → Datasources → New**.
2. Enter a name and select **ClickHouse** as the type.
3. Fill in the URL, username, and password.
4. Optionally specify a default database.
5. Click **Test connection** to verify.
6. Click **Create**.

## Troubleshooting

* **Connection refused**: Confirm the URL includes the correct port (8443 for ClickHouse Cloud, 8123 for self-hosted without TLS).
* **Authentication failed**: Verify the username and password. The default ClickHouse user is `default`.

## Related

* [Catalog sync](/datasources/catalog)
* [Managing datasources](/datasources/manage)
