Connecting Metabase to ClickHouse involves installing the ClickHouse driver, configuring connection details in Metabase, and optimizing settings for high-performance analytical querying.
Metabase is an open-source business intelligence tool that lets you build dashboards and run ad-hoc queries through a friendly UI. ClickHouse is a high-performance, column-oriented OLAP database designed for sub-second analytics at scale. Connecting the two enables data teams to explore massive datasets with visual, self-service analytics while leveraging ClickHouse’s speed.
ClickHouse’s superior read performance makes it ideal for time-series, event, and log data. Metabase adds an intuitive layer on top so non-technical stakeholders can build charts without memorizing SQL. Together, they create an analytics stack that is both powerful and accessible.
SELECT
permissions on relevant databases.You’ll need the ClickHouse host, port, database name, username, and password. If you use TLS, note the HTTPS port (8443 by default) and CA certificates.
From the Metabase host, test connectivity with:
curl https://clickhouse.example.com:8443/ping
# or non-TLS
curl http://clickhouse.example.com:8123/ping
If you get Ok.
as the response, ClickHouse is reachable.
Open http://<metabase-host>:3000
in your browser and sign in as an admin.
clickhouse.example.com
8443
for HTTPS or 8123
for HTTP.default
.Metabase runs a connection test, then starts a background sync to ingest metadata.
Open Admin → Databases, click your ClickHouse entry, and confirm tables appear under Browse data. Large schemas may take minutes—watch the progress log at Admin → Troubleshooting → Logs
.
SAMPLE
clause so Metabase can run fast approximations.max_bytes_before_external_group_by
higher for heavy aggregations.ORDER BY (timestamp, id)
).readonly
profile.Large schemas or many partitions slow down Metabase’s initial field fingerprinting. Reduce Sample Size to 1000 rows or temporarily disable voluminous tables.
Error 516 indicates invalid credentials or user lacks permission on system
tables. Grant SELECT
on system.*
or use a more privileged role.
Metabase relies on field types. If a ClickHouse column is String
but stores ISO dates, Metabase classifies it as Category. Override the field type to Date under Admin → Data Model.
Before wiring a question or dashboard in Metabase, many engineers prototype queries in a dedicated SQL editor. Galaxy offers a native ClickHouse connection with context-aware AI that autocompletes functions like quantileMerge
and arrayJoin
. You can:
Suppose you store page-view events in ClickHouse:
CREATE TABLE prod.events
(
event_time DateTime,
user_id UInt32,
page String,
duration_ms UInt32
)
ENGINE = MergeTree()
ORDER BY (event_time, user_id);
In Galaxy you test:
SELECT page,
count() AS views,
quantileExact(0.9)(duration_ms) AS p90_load
FROM prod.events
WHERE event_time >= today() - 7
GROUP BY page
ORDER BY views DESC
LIMIT 20;
After validation, paste the SQL into Metabase’s Native Query card, add visualization settings, and pin it to a dashboard. Done!
Connecting Metabase to ClickHouse is straightforward: supply credentials, pass the connection test, and let Metabase ingest metadata. From there you gain a high-performance, self-service analytics environment over billions of rows. Combine this setup with Galaxy’s developer-friendly SQL editor to prototype and share ClickHouse queries even faster.
ClickHouse delivers lightning-fast analytical queries, but without a visualization layer its power remains inaccessible to stakeholders. Metabase bridges that gap, enabling self-service dashboards on top of petabyte-scale data. Mastering this connection lets data engineers expose insights securely and rapidly across an organization.
No. Since Metabase 0.46 the ClickHouse JDBC driver is bundled by default, so you only need to configure the connection.
Absolutely. Galaxy connects to ClickHouse natively, letting you prototype complex SQL with AI-driven autocompletion. Once your query is polished, copy it into Metabase’s Native Query interface.
Enable HTTPS on ClickHouse, upload the CA certificate in Metabase, and restrict the user to readonly access. Alternatively, place both services behind the same VPN.
Metabase infers field types during sync. Override the problematic column’s type to Date or Timestamp in Admin → Data Model so filters become available.