---
title: "Configure the ClickHouse connection | Grafana Labs"
description: "Enter the connection details, protocol, and read-only credentials for your ClickHouse server."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Configure the ClickHouse connection

In this milestone, you enter the connection details so Grafana Cloud can reach your ClickHouse server. You’ll set the server address, protocol, port, and the read-only credentials you created earlier.

To configure the connection, complete the following steps.

1. In the **Server address** field, enter the hostname or IP address of your ClickHouse server.
   
   For example, enter `clickhouse.example.com`.
2. For **Protocol**, select **Native** for best performance. Choose **HTTP** instead if your network requires HTTP-based connectivity, for example through a reverse proxy.
3. In the **Server port** field, enter the port that matches your protocol. Native uses `9000` (or `9440` with TLS); HTTP uses `8123` (or `8443` with TLS).
4. In the **Username** field, enter the read-only user you created earlier.
   
   For example, enter `grafana_reader`.
5. In the **Password** field, enter the password for your read-only user.
   
   For your security, enter this value yourself rather than having Grafana fill it in.

Your connection details are in place.

**Optional settings:**

- **Secure Connection:** If your ClickHouse server uses TLS, enable **Secure Connection**, then set the **Server port** to a TLS-enabled port. Grafana doesn’t change the port automatically when you toggle TLS.
- **Default database:** For self-hosted ClickHouse, set the database you query most often. On ClickHouse Cloud you can leave this blank, because Cloud routes to the correct database. A blank value makes the plugin use the `default` database, and setting a name that doesn’t exist can cause an `Unknown database` error.

In the next milestone, you’ll save and test the connection.

* * *

### More to explore (optional)

- [Configure the ClickHouse data source](/docs/plugins/grafana-clickhouse-datasource/latest/configure/#configure-settings)
- [ClickHouse protocol support and default ports](/docs/plugins/grafana-clickhouse-datasource/latest/configure/#clickhouse-protocol-support)
