Connect to ClickHouse
Securely connect your Hex workspace to your ClickHouse database.
- Users need the Admin workspace role to create a shared workspace data connection.
- Users need Can Edit or higher project permissions to create project data connections.
ClickHouse is an open-source column-oriented database management system (DBMS) optimized for online analytical processing (OLAP). It's designed to enable fast, real-time data analysis. ClickHouse achieves its speed and efficiency by employing column-based storage, vectorized query execution, and a range of other data processing optimizations.
You might want to use ClickHouse in scenarios that involve querying and processing large volumes of data. This could include analyzing logs, performing real-time analytical processing, processing time-series data, and running full-text searches, among other uses. It is often used in cases where real-time data analysis is critical.
If you have relatively small data or are very early, using something lightweight like Postgres or uploading csvs or parquet files to our DuckDB integration could also be good options.
How to get set up
- Set up a ClickHouse database, either by hosting it on your own infrastructure or signing up for ClickHouse Cloud.
- Set up a Clickhouse username and password for usage by Hex.
- In Hex, go to Settings → Data sources.
- Click + Connection, select ClickHouse, and fill out the fields below.

Basic settings
- Name and Description - Set a display name and optional description to help identify your data connection.

- Host - The address of your Clickhouse database.
- Port - The port used for secure native connections to your ClickHouse database. This is usually 9440 (see Clickhouse documentation).
- Username - The Clickhouse username set up for usage by Hex.
- Password - The Clickhouse password.

Additional settings
The data connection form includes several optional sections:
- Advanced - Optional settings like custom SQL formatting, including schema data for AI, and connecting via SSH.
- Access - Optional data connection permissions.
- Schema browsing - Recommended settings like scheduling schema browser refreshes and schema filtering, both of which are recommended for performance and AI agent accuracy.
If you use a firewall to restrict database access, you'll need to add Hex's IP addresses to your allowlist.