Connecting Metabase to ClickHouse

Connect a self-hosted Metabase to self-managed ClickHouse or ClickHouse Cloud, and learn which features need ClickHouse Cloud and which isolation controls ClickHouse does and does not provide.

On this page

Connecting Metabase to ClickHouse: what the integration does and where it stops

An analytics team that wants governed Metabase dashboards over ClickHouse data should know first that Metabase connects through its official ClickHouse driver, and the docs example uses HTTP port 8123. That makes the connection a query path: Metabase sends SQL to ClickHouse, reads results, and renders saved questions and dashboards. It does not copy your data into Metabase, and it does not give you a managed ingestion layer. Whatever ClickHouse tables your database user can read are what Metabase can chart, so the work starts with the ClickHouse side of the access model, not the Metabase side.

Two features in the Metabase toolset depend on where ClickHouse runs. CSV uploads and transforms work with ClickHouse only on ClickHouse Cloud, so a self-managed ClickHouse cluster cannot use them. Plan recurring data preparation inside ClickHouse or in a pipeline you operate if you run your own cluster. Confirm the current support matrix with Metabase's ClickHouse documentation before you commit to a design that depends on either feature.

On isolation, the boundary is different from what many teams expect. Database routing is not supported on ClickHouse, so you cannot send different groups to different ClickHouse databases through Metabase routing. Impersonation is available for ClickHouse, which lets ClickHouse roles, rather than one shared service account, decide which rows and tables a Metabase user can query. Test impersonation with a non-admin user against a representative table before you rely on it, and record which ClickHouse roles map to which Metabase groups.

What the ClickHouse connection needs before setup

A Metabase connection to ClickHouse depends on decisions made in three places: the ClickHouse service, the Metabase instance and the network between them. Settle these before opening the connection form, because the answers decide which Metabase features are available and how much of the data your users can reach.

Self-managed server or ClickHouse Cloud

The ClickHouse server is open source under the Apache License 2.0, so you can run it in your own infrastructure. ClickHouse Inc. separately sells ClickHouse Cloud as a managed service, and that is a different commercial relationship with its own terms. Decide which one you are connecting to, because some Metabase features, including CSV uploads and transforms, work only on ClickHouse Cloud. Confirm the deployment model with your procurement and data governance teams before the design starts.

ClickHouse repository

Supported ClickHouse release line

The ClickHouse security policy lists the release lines that currently receive security updates, and every other version is unsupported. Pick a line from that list and plan to move with it, since a server on an unsupported version will not receive security fixes. Read the changelog before each upgrade, because minor backward-incompatible changes can occur. Test upgrades in a pre-production environment with representative data and queries first.

ClickHouse security policy

Dedicated read-only database user

Create a ClickHouse user that Metabase uses only for queries, with read grants limited to the databases and tables your analysts need. Metabase should not connect as an administrator. Review the access control documentation to confirm how grants, roles and profiles work on your release line. This user is also the identity that impersonation and database-level permissions in Metabase depend on, so name it deliberately.

ClickHouse access control docs

Metabase version and plan

The ClickHouse driver is official and ships with Metabase, so the connection itself does not need a paid plan. Impersonation for ClickHouse, and SSO into the Metabase instance, do require Pro or Enterprise, and row and column level permissions also sit in those plans. Confirm the plan you need against Metabase's pricing page before you rely on per-user ClickHouse access. Choose a Metabase release that is still supported and plan its upgrades.

Metabase pricing

Port 8123 reachability

The Metabase connection example uses port 8123, which is ClickHouse's HTTP interface. Open that port only from the Metabase server or its subnet, and keep it closed to general user networks. Check any firewall, security group or load balancer between the two systems, and confirm that the DNS name Metabase uses resolves to the right endpoint. Test reachability from the Metabase host itself, not from your workstation.

Metabase ClickHouse docs

TLS for the query path

Decide whether queries between Metabase and ClickHouse travel over TLS on port 8123, and who manages the certificates. Requiring TLS protects credentials and result sets on the network, and a private certificate authority needs to be trusted by the Metabase host. Document this choice in your architecture record, because auditors and security reviewers will ask how database traffic is protected.

How to add ClickHouse as a Metabase database

This sequence takes a self-hosted Metabase from a ClickHouse server with no Metabase access to a working connection that returns known rows. It covers a read-only ClickHouse user, the connection in Metabase admin, the first sync and scan, and a test question checked against a table someone can verify.

  1. Confirm the ClickHouse deployment and network path

    Before creating any accounts, the ClickHouse owner confirms which deployment Metabase will reach, either self-managed ClickHouse or ClickHouse Cloud, and that the Metabase application server can open a network connection to the HTTP interface on port 8123. Confirm the exact endpoint, TLS requirements and firewall rules with your ClickHouse team and network team, because these settings depend on your environment. The step is done when someone outside Metabase can reach the endpoint from the Metabase host and receive a response.

  2. Create a read-only ClickHouse user

    A ClickHouse administrator creates a dedicated user for Metabase, grants it read-only access to the specific databases and tables the analysts need, and sets a strong credential stored in your secrets manager. Use the access control documentation to confirm the grant syntax for your version, and avoid the default user or an administrator account. The step is done when the new user can run a SELECT against an approved table and receives an access error when it tries to read or write a database outside its grant list.

  3. Add the ClickHouse connection in Metabase admin

    A Metabase administrator opens the admin settings, chooses Add database, selects ClickHouse, and enters the host, port 8123, the database name, and the read-only user's credentials. Metabase includes an official ClickHouse driver, so no community driver is needed. Confirm the connection settings with the ClickHouse documentation for your deployment, including any TLS options. The step is done when the connection test in the form reports success.

  4. Confirm the sync scope and run the initial sync

    In the database settings, the administrator reviews which schemas and tables Metabase will sync and turns off any database or table that should not appear to users. The first sync reads table and field metadata from ClickHouse, and a field scan then samples values for filters and dropdowns. Watch the Metabase activity or log output until the sync completes without errors. The step is done when the expected tables appear in the data browser with their column types.

  5. Run a test question against a known table

    Choose a table whose row count is known from ClickHouse itself, for example by running a count query in the ClickHouse client beforehand, then build a simple question in Metabase that counts its rows. Compare the Metabase result with the ClickHouse result, and then check one filtered value as well. Record both numbers so they can be repeated after upgrades or permission changes. The step is done when the Metabase count matches the ClickHouse count for the same table and filter.

  6. Confirm access is limited as designed

    Sign in to Metabase as a test user in a group that should have limited access, and confirm they see only the databases and collections their group allows. Because ClickHouse does not support database routing, plan any per-user data restriction around the ClickHouse user grants and the impersonation options that ClickHouse supports. Ask your security team to review the result before analysts receive access. The step is done when the test user sees only the approved data and the query for an unapproved table is refused.

Which features change on ClickHouse Cloud versus self-managed ClickHouse

When Metabase connects to a ClickHouse server you run yourself, the core connection works as documented: Metabase uses its official ClickHouse driver, and the connection example in Metabase's docs uses port 8123. Analysts can explore tables, build questions, and create dashboards against the data the server already holds. The features below are the ones to plan around, because they are not available on this deployment model.

  • CSV uploads are not available: Metabase's uploads feature supports ClickHouse only on ClickHouse Cloud, so people cannot load spreadsheets into a self-managed cluster from Metabase. Recurring data has to arrive through your own pipeline.
  • Transforms are not available: Metabase's transforms also depend on ClickHouse Cloud, so derived tables must be built upstream, for example by a scheduled job in your orchestration tool.
  • Impersonation is available: Metabase supports impersonation for ClickHouse, so per-user access can be enforced by the database roles you define on the server. Confirm which role and user mapping your version requires.
  • Database routing is not supported: Metabase does not support database routing on ClickHouse, so a single connection cannot be split by tenant or group in Metabase itself.
  • Operations stay with your team: Upgrades, replication through ClickHouse Keeper, and backups are your responsibility, and the backup and restore procedures must be tested.

Before locking the design, confirm the current feature list for self-managed ClickHouse in Metabase's ClickHouse documentation.

How a Metabase question reaches ClickHouse

The flow starts with a user's browser sending a question to Metabase, which reads connection and permission metadata from its application database. Metabase then sends the query through the ClickHouse driver on port 8123, crossing a trust boundary into the ClickHouse network zone. Inside ClickHouse, the query runs under a read-only Metabase user, and impersonation can apply a role per user. Check that the read-only account and impersonated role are the only paths to the data, and that the driver port is reachable only from Metabase.

Query path from a browser through Metabase into ClickHouse, with the trust boundary between zones.

Which Metabase permissions map to which ClickHouse controls

This table maps each Metabase permission control to the ClickHouse control that enforces it on self-managed ClickHouse or ClickHouse Cloud. Read it as a checklist: Metabase decides what people see in the interface, while ClickHouse grants decide what a query can read. The main takeaway is that database routing cannot split access on ClickHouse, so per-user separation depends on impersonation and grant design.

Metabase controlClickHouse controlWhat to confirm or design
Metabase groups with data permissionsOne ClickHouse role or user per access tier, mapped by handGroup membership in Metabase does not create ClickHouse users or grants. Decide the mapping before rollout and document it.
Table-level data access in a groupGRANT SELECT on named databases and tables to a roleAvoid wildcard grants so a group cannot query tables it should not see. Review grants after each new table is created.
Impersonation (per-user identity)ClickHouse identity set per Metabase user, with that identity's grants appliedImpersonation is available for ClickHouse. Confirm the setup steps in Metabase's impersonation documentation and test with two users.
Database routingNot supported on ClickHouseOne connection serves all routing needs. Separate access must come from ClickHouse users, roles and grants, not from routing.
Row-level restrictions in MetabaseDepends on ClickHouse row policies or query design, to confirmMetabase row-level permissions are included only in Pro and Enterprise plans. Confirm whether ClickHouse policies cover the same rule.
Column-level restrictions in MetabaseColumn-level grants in ClickHouse, to confirm against your versionMetabase column-level permissions are included only in Pro and Enterprise plans. Test a restricted column from each group.
Metabase connection userRead-only ClickHouse user with SELECT grants onlyKeep administrative ClickHouse accounts out of the Metabase connection. Admin tasks should use separate, audited accounts.
CSV uploads and transformsWrite grants, supported on ClickHouse Cloud onlyGrant write access only where uploads or transforms are planned. Limit writes to a dedicated schema.

Which data isolation options ClickHouse supports and which it does not

ClickHouse supports isolation through its own access control: users, roles and grants that can be scoped to databases and tables. This is the layer that should decide who can read which data, and it is the one to design first. Create a dedicated role per audience, grant SELECT only on the databases and tables that audience needs, and avoid giving the Metabase connection user administrative rights or access to system tables it does not need. The ClickHouse access control documentation describes the grant model, and the team should confirm the exact privilege names and scoping syntax for the ClickHouse version it runs before writing them into a runbook.

Metabase can sit on top of that model in two ways, and the difference matters. Impersonation is available for ClickHouse, so Metabase can pass the signed-in user's identity or attribute to the database and let the database enforce its grants. Database routing is not supported on ClickHouse, so a single Metabase instance cannot send different groups to different ClickHouse databases or clusters based on a tenant or business unit. If the design depends on routing, it has to change before rollout: either separate Metabase instances per isolation boundary, or separate ClickHouse users and connections managed in Metabase with permissions set per group. Both options carry operational cost, and the team should price that cost into the design rather than discover it later.

Do not promise row-level or tenant segregation to customers on the strength of this page. Confirm current ClickHouse capabilities for row policies and per-tenant filtering against the ClickHouse documentation for the exact release in use, and confirm how Metabase's row and column level permissions and multi-tenant data segregation interact with a ClickHouse connection on the Metabase plan being bought. Those features are listed for the Pro and Enterprise plans, so an open source deployment cannot rely on them. Record the answer in writing, test it with a non-administrative user on representative data, and only then describe the isolation to customers or auditors.

Hardening the ClickHouse connection in Metabase

The Metabase connection to ClickHouse is only as narrow as the ClickHouse account behind it. The cards below cover the controls that limit what that account can read, how it authenticates, how traffic is protected and where its password is kept. Each control should be confirmed in your own ClickHouse environment before the connection is opened to business users.

Create a read-only ClickHouse user

Give the Metabase connection its own ClickHouse user that holds only SELECT grants on the databases and tables people need to query. Do not reuse an administrative account or a loader account that can write. Confirm the grants by logging in as that user and attempting an INSERT or DDL statement, which should fail. Review the grants again whenever a new database is added to Metabase, because new tables do not inherit a narrower scope automatically in every setup.

ClickHouse access control docs

Use least-privilege roles for impersonation

If you use Metabase impersonation with ClickHouse, map each Metabase group to a ClickHouse role that grants only the tables that group may see, and set the Metabase connection user to hold only the rights needed to assume those roles. Impersonation is available for ClickHouse, but database routing is not, so this is the place to enforce per-group data boundaries. Test each role with a sample query before go-live, since a broad role silently widens access for every user in the group.

Metabase impersonation docs

Choose an external authenticator

ClickHouse can delegate sign-in to LDAP directories, Kerberos, SSL X.509 certificates, an HTTP authenticator or JWT tokens. Pick one method for the Metabase connection based on what your directory and certificate authority already operate, and confirm it works for the exact ClickHouse version you run. Certificate-based access avoids a stored password entirely, but it requires certificate issuance and rotation to be owned by a team. Record which method you chose and who maintains it.

ClickHouse external authenticators docs

Encrypt the connection with TLS

Send Metabase queries to ClickHouse over an encrypted connection, and verify the server certificate against the correct certificate authority rather than disabling verification to get a working setup. Metabase connects over the HTTP interface on port 8123 in its documented example, so confirm whether your deployment uses plain HTTP inside a private network or an HTTPS endpoint, and make that choice explicit in your network design. Check the certificate expiry date as part of routine monitoring.

Metabase ClickHouse docs

Store the connection password in a secret store

Keep the ClickHouse password out of configuration files, container images and the Metabase admin screen where others with admin rights can read it. Inject it at runtime from your secrets manager or orchestrator, and restrict who can read that secret to the team that runs Metabase. Rotate the password on a schedule and after any staff change, and confirm that the rotation procedure includes a Metabase connection update and a test query.

Separate the application database from ClickHouse

Metabase stores its own data, including users, questions and settings, in an application database such as PostgreSQL. That database and the ClickHouse connection should use different accounts, different credentials and different network paths. A compromise of one should not give access to the other. Verify this by listing which credentials Metabase holds and confirming that the ClickHouse user cannot log in to the application database.

Why ClickHouse replication does not replace tested backups

Replication keeps copies of data available, but it does not keep a history of them. On a self-managed ClickHouse cluster, replicated tables use the ReplicatedMergeTree engine, and ClickHouse Keeper coordinates the replicas, replacing ZooKeeper. The replication guide recommends at least three Keeper nodes, run on dedicated hosts in production with about 4 GB of RAM each. If a replica fails and is later recovered, it automatically syncs missing data from a healthy replica without manual intervention. That behavior protects against hardware loss. It does not protect against a bad DROP TABLE or a faulty ALTER or DELETE run on a Metabase-facing table, because the change replicates to every copy within moments.

The protection you need is a separate, point-in-time copy made with BACKUP and RESTORE. ClickHouse can write full and incremental backups of tables, partitions or whole databases to local disk, S3-compatible storage or Azure Blob Storage, as described in the backup and restore documentation. Choose the destination with the same care you give the cluster: an object store in a separate account or failure domain is usually a stronger choice than a disk on the same hosts. Confirm with your ClickHouse team which databases hold the tables Metabase queries, how often backups run, and who holds permission to run RESTORE.

A backup that has never been restored should be treated as unproven. The same documentation warns that a backup never test-restored will probably not restore properly when needed, and recommends regular restore tests on a spare cluster. Plan a scheduled restore into a non-production environment, then point a test Metabase connection at the restored data and run the saved questions and dashboards your teams depend on. Record how long the restore took and whether row counts and key queries match the source. That result tells you the recovery time you can actually promise, and it is the evidence your compliance reviewers will ask for.

Common ClickHouse connection failures in Metabase and their fixes

This table pairs the failures teams most often hit when connecting Metabase to ClickHouse with the likely cause and the first check to run. Work through the rows in order, since network reachability and the HTTP port come before credentials, grants and feature settings. Each first check is a diagnostic step you can run without changing the production setup.

SymptomLikely causeFirst check
Connection refused or timeout on port 8123The Metabase host cannot reach the ClickHouse HTTP interface, or the port in the connection settings does not match the server configurationFrom the Metabase host, confirm that port 8123 is reachable on the ClickHouse host and that the firewall or security group allows it. Then confirm the HTTP port configured on the server
Authentication failure with the read-only userThe password is wrong or stale, the user is defined for a different host or network, or the account is locked to an authentication method the connection does not useTest the same credentials with a ClickHouse client from the Metabase host. Check that the user exists and that its allowed host settings include the Metabase server address
Connection succeeds but tables are missing from the schema listThe read-only user lacks SHOW and SELECT grants on the databases or tables, so Metabase cannot see them during syncQuery the user's grants and confirm SELECT and SHOW privileges on the target databases. Run a sync after the grants change and check the sync log
Some tables appear but queries return access errorsGrants were applied to some databases only, or a row policy or column restriction on the server hides data from the Metabase userCompare the user's grants with the tables that fail. Check whether row policies apply to that user and whether the table is in a database the user can read
Upload or transform options are missingCSV uploads and transforms work only on ClickHouse Cloud according to Metabase's documentation, so a self-managed ClickHouse does not offer themConfirm whether the target is ClickHouse Cloud or self-managed. On self-managed ClickHouse, plan recurring loads through your pipeline rather than expecting these options to appear
Impersonation does not restrict data as expectedImpersonation depends on the ClickHouse user and role configuration, and database routing is not supported on ClickHouse, so the setup may not map Metabase groups to the intended ClickHouse identitiesLog in as a test user in Metabase and run a query. Then check which ClickHouse user the query ran as in the server query log, and confirm the grants on that user
Metabase connects to the wrong database or cluster nodeThe connection settings point to a host or endpoint that differs from the one used by the team that set up the environment, or a load balancer routes to a replica that lagsVerify the host, port and database in the connection settings against the server inventory. Confirm which node or endpoint responds to a simple query from the Metabase host
Queries slow or time out after a successful connectionThe read-only user runs heavy scans, or the server has limited resources or no pre-production sizing for Metabase queriesReview the slow queries in the server logs and check resource use during dashboard loads. Confirm timeouts in both Metabase and the server before changing either

Questions buyers ask before connecting ClickHouse to Metabase

Can our team connect Metabase to ClickHouse without a partner?

Yes, a team with ClickHouse administration skills and someone who owns the Metabase instance can make the basic connection alone, because Metabase maintains an official ClickHouse driver and the connection itself is a configuration task. The harder work is the surrounding design: which ClickHouse user Metabase runs as, how grants are scoped to databases and tables, how TLS is configured, and how backups and restore tests are run. Teams that have not run ClickHouse in production often find those areas take longer than the connection. DeployOpen can plan and build that work under a written, fixed scope, or review a design your team has already drafted.

What drives the effort of a ClickHouse to Metabase connection?

Effort rises with the number of databases and schemas Metabase must read, the complexity of the grants model, and how many separate Metabase groups need different visibility. Other drivers include whether TLS and external authentication are required, whether impersonation is used to enforce per-user access, and whether the target is ClickHouse Cloud or a self-managed cluster. Self-managed clusters add replication design, ClickHouse Keeper, backups and upgrade planning. Ask any partner to show how each of these items appears in the written scope, so the quote can be compared against your own estimate.

Does our Metabase plan change how ClickHouse connects?

Yes. Impersonation is available for ClickHouse, and it is the mechanism that lets ClickHouse enforce per-user access for queries made through Metabase. According to Metabase's pricing page, SSO, row and column level permissions, multi-tenant data segregation and usage analytics and auditing are included only in the Pro and Enterprise plans, not in Open Source or Starter. Database routing is not supported on ClickHouse. Confirm the current plan details on the Metabase pricing page before you design the permission model, since a team on Open Source may need to rely on separate database connections instead.

Which features work only on ClickHouse Cloud?

According to Metabase's documentation, CSV uploads and transforms support ClickHouse only on ClickHouse Cloud. If your analysts need to upload spreadsheets or build transforms inside Metabase, a self-managed ClickHouse cluster will not provide those features. Self-managed deployments can still run saved questions, dashboards and queries against the cluster. Before choosing a hosting model, list the Metabase features your teams need and check each one against the current Metabase ClickHouse documentation, because feature support can change between releases.

How does ClickHouse release support affect our plan?

ClickHouse publishes stable releases roughly monthly and LTS releases twice a year, and its security policy lists which versions receive security updates at any time. The production FAQ recommends stable releases for most production use, a pre-production environment with representative data and queries, and reading the changelog before upgrading, because minor backward-incompatible changes can occur. Plan an upgrade cadence that stays within a supported line, and budget test time for each upgrade. Confirm the current supported versions on the ClickHouse security policy before you pick a version to standardize on.

What must our team provide before the connection project starts?

Your team should provide a test environment with representative data and queries, named owners for the ClickHouse cluster and the Metabase instance, and a list of the databases, tables and user groups that Metabase must expose. You will also need the network path between Metabase and ClickHouse, the TLS certificates or authentication method your security team approves, and a backup location that the cluster can write to. Before go-live, the team should run a restore test on a spare cluster, since the ClickHouse backup documentation warns that a backup never test-restored will probably not restore properly when needed.

Does replication in ClickHouse protect us from data loss?

Replication protects against hardware failure on a node, but it does not protect against human error or corruption. ClickHouse replicates data with ReplicatedMergeTree tables coordinated by ClickHouse Keeper, and a recovered replica syncs missing data from a healthy replica automatically. A bad delete or a corrupted table can still replicate to every copy, so the ClickHouse backup and restore documentation recommends full and incremental backups to local disk, S3-compatible storage or Azure Blob Storage, with regular restore tests on spare clusters. Ask your partner or internal team to show where backups are stored and when the last restore test ran.

How should ClickHouse authentication and TLS be set up for Metabase?

Create a dedicated ClickHouse user for Metabase with read-only grants limited to the databases and tables it must query, and avoid using the default user. ClickHouse supports LDAP, Kerberos, SSL X.509 certificates, an HTTP authenticator and JWT authentication as external authenticators, so choose the method your identity team already operates. Serve the connection over TLS and validate the certificate chain, since Metabase connects over the ClickHouse HTTP interface on port 8123 in its documented example. Confirm the exact connection settings with the Metabase ClickHouse documentation and your security team before rollout.

How DeployOpen scopes and delivers the ClickHouse connection

DeployOpen treats the Metabase to ClickHouse connection as a designed piece of your analytics platform, not a single settings form. We agree the deployment target, the isolation model and the ClickHouse features you need in writing first, then build, test and hand over the result inside your own infrastructure.

How we scope

  • Confirm whether ClickHouse runs self-managed or on ClickHouse Cloud, since CSV uploads and transforms depend on it.
  • Record which Metabase plan applies, because impersonation and permission controls depend on Pro or Enterprise.
  • Agree which datasets, users and isolation approach Metabase will use before any connection is built.

How we build

  • Configure the official ClickHouse driver with a dedicated, read-scoped database user and tested network paths.
  • Test ClickHouse authentication options, such as LDAP, JWT or certificates, against your directory and security policy.
  • Verify replication and backup behavior on the ClickHouse side, so the analytics layer does not depend on untested recovery.

How we hand over

  • Deliver a written configuration record covering connection settings, user grants, permission mappings and known limits.
  • Document which features are unavailable on your deployment, such as database routing, and what workaround was chosen.
  • Provide a restore test runbook and walk your platform and data teams through daily operation.

How we support

  • Offer ongoing support, version upgrade planning and continuous testing as a retainer after handover.
  • Review the ClickHouse changelog and supported version lines with you before each planned upgrade.
  • Repeat connection and permission checks after Metabase or ClickHouse upgrades, and report any changes found.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.