ClickHouse
Overview
ClickHouse is an open-source, column-oriented OLAP database management system known for its ability to perform real-time analytical queries on large-scale datasets. Its architecture is optimized for high performance, leveraging columnar storage and advanced compression techniques to speed up data reads and significantly reduce storage costs. ClickHouse's efficiency in query execution, scalability, and ability to handle even petabytes of data makes it an excellent choice for real-time analytic use cases.
Rill supports connecting to an existing ClickHouse instance and using it as an OLAP engine to power Rill dashboards built against external tables. This is particularly useful when working with extremely large datasets (hundreds of GBs or even TB+ in size).
Rill supports connecting to ClickHouse v22.7 or newer versions.
Configuring Rill Developer with ClickHouse
When using ClickHouse for local development, you can connect via connection parameters or using the DSN. Both local instances of ClickHouse and Cloud are supported.
- Connect to an OLAP engine via Add Data. This will automatically create the
clickhouse.yaml
file in yourconnectors
folder and populate the.env
file withconnector.clickhouse.password
orconnector.clickhouse.dsn
depending on which you select in the UI.

# Connector YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/connectors
type: connector
driver: clickhouse
host: <HOSTNAME>
port: <PORT>
username: <USERNAME>
password: "{{ .env.connector.clickhouse.password }}"
ssl: true #required for ClickHouse Cloud
#or
dsn: "{{ .env.connector.clickhouse.dsn }}"
- You can create/edit the
.env
file manually in the project directory and addconnector.clickhouse.dsn
- If this project has already been deployed to Rill Cloud, you can try pulling existing credentials locally using
rill env pull
. - You can pass in
connector.clickhouse.dsn
as a variable torill start
directly (e.g.rill start --env connector.clickhouse.dsn=...
)
.env
?If you are facing issues related to DSN connection errors in your dashboards even after setting the connection string via the project's .env
file, try restarting Rill using the rill start --reset
command.
Connection string (DSN)

Rill is able to connect to ClickHouse using the ClickHouse Go Driver. An appropriate connection string (DSN) will need to be set through the connector.clickhouse.dsn
property in Rill.
A very simple example might look like the following:
connector.clickhouse.dsn="clickhouse://<hostname>:<port>?username=<username>&password=<password>"
In most situations, the default port is 9440 for TLS and 9000 when not using TLS. However, it is worth double checking the port that your ClickHouse instance is configured to use when setting up your connection string.
For more information about available DSN properties and setting an appropriate connection string, please refer to ClickHouse's documentation.