---
title: "ClickHouse"
description: "Learn how to connect Metabase to your ClickHouse database, including supported versions, the built-in driver, a read-only user, connection settings, database selection, and SSL configuration."
url: "https://www.metabase.com/docs/latest/databases/connections/clickhouse"
version: "65"
---

> For the complete documentation index, see [llms.txt](https://www.metabase.com/docs/llms.txt).

# ClickHouse

To add a database connection, click the **grid** icon in the top right, and navigate to **Admin** > **Databases** > **Add a database**.

You can edit these settings at any time. Just remember to save your changes.

## Supported versions

Metabase supports ClickHouse 23.3 and later, on ClickHouse Cloud and on self-managed ClickHouse. [Impersonation](https://www.metabase.com/docs/latest/permissions/impersonation.md) requires ClickHouse 24.4 or later.

If you set a [report time zone](https://www.metabase.com/docs/latest/configuring-metabase/localization.md#set-default-instance-report-timezone) in Metabase, use ClickHouse 23.6 or later. Metabase sends the `session_timezone` setting with each query, and ClickHouse added that setting in 23.6.

The ClickHouse driver is included with Metabase as of version 54.1, so you don't need to download or install a driver. Metabase maintains the driver in the [metabase/metabase](https://github.com/metabase/metabase) repository. The earlier partner driver in [ClickHouse/metabase-clickhouse-driver](https://github.com/ClickHouse/metabase-clickhouse-driver) is archived. If your `plugins` folder still contains `clickhouse.metabase-driver.jar`, you can delete it.

## Connection and Sync

After connecting to a database, you'll see the "Connection and sync" section that displays the current connection status and options to manage your database connection.

Here you can [sync the database schema and rescan field values](https://www.metabase.com/docs/latest/databases/sync-scan.md), and edit connection details.

## Edit connection details

To access or modify your database connection settings, click the **Edit connection details** button.

### Connection string

Paste a connection string here to pre-fill the remaining fields below.

### Display name

The display name for the database in the Metabase interface.

### Host

Your database's IP address (e.g., `98.137.149.56`) or its domain name (e.g., `name.database.com`).

### Port

The database port (e.g., `8123`).

### Username

The username Metabase uses to connect to your database. Create a dedicated database user for Metabase with read-only access to the schemas and tables you want to analyze. For write operations like uploads, actions, or transforms, use a separate [writable connection](https://www.metabase.com/docs/latest/databases/writable-connection.md). For instructions, see [Database users, roles, and privileges](https://www.metabase.com/docs/latest/databases/users-roles-privileges.md). You can set up multiple connections to the same database using different user accounts, each with different sets of privileges.

### Password

The password for the username that you use to connect to the database.

### Databases

Include all of the databases you want to be able to query in Metabase. Separate databases with the space character, e.g., `db1 db2 db3`.

### Scan all databases

Scan all tables from all available ClickHouse databases except the system ones.

### Use a secure connection (SSL)

See [SSL certificates](https://www.metabase.com/docs/latest/databases/ssl-certificates.md).

### Use an SSH-tunnel

If a direct connection to your database isn't possible, you may want to use an SSH tunnel. See [SSH tunneling](https://www.metabase.com/docs/latest/databases/ssh-tunnel.md).

### Disable system wide proxy settings

System-wide proxy settings are disabled by default. You can disable them with this toggle.

### ClickHouse settings (comma-separated)

Here you can add a string to specify additional ClickHouse settings. Separate settings with a comma, like so:

```
allow_experimental_analyzer=1,max_result_rows=100
```

### Max open HTTP connections in the JDBC driver (default: 100)

You can limit the number of HTTP connections in the JDBC driver used to connect Metabase to ClickHouse.

### Additional JDBC connection string options

You can append options to the JDBC connection string. All [server settings must be prefixed with `clickhouse_setting_`](https://clickhouse.com/docs/integrations/language-clients/java/jdbc#connection-properties). Separate options with `&`, like so:

```
clickhouse_setting_connection_timeout=1000&clickhouse_setting_socket_timeout=300000
```

### Re-run queries for simple explorations

Turn this option **OFF** if people want to click **Run** (the play button) before applying any [Summarize](https://www.metabase.com/docs/latest/questions/query-builder/summarizing-and-grouping.md) or filter selections.

By default, Metabase will execute a query as soon as you choose a grouping option from the **Summarize** menu or a filter condition from the [drill-through menu](https://www.metabase.com/docs/latest/questions/visualizations/drill-through.md). If your database is slow, you may want to disable re-running to avoid loading data on each click.

### Choose when syncs and scans happen

See [syncs and scans](https://www.metabase.com/docs/latest/databases/sync-scan.md#choose-when-syncs-and-scans-happen).

### Periodically refingerprint tables

> Periodic refingerprinting will increase the load on your database.

Turn this option **ON** to scan a sample of values every time Metabase runs a [sync](https://www.metabase.com/docs/latest/databases/sync-scan.md#how-database-syncs-work).

A fingerprinting query examines the first 10,000 rows from each column and uses that data to guesstimate how many unique values each column has, what the minimum and maximum values are for numeric and timestamp columns, and so on. If you leave this option **OFF**, Metabase will only fingerprint your columns once during setup.

## Writable connection

Set up an additional connection used for write operations. See [Writable connections](https://www.metabase.com/docs/latest/databases/writable-connection.md).

## Uploads

Metabase supports [CSV uploads](https://www.metabase.com/docs/latest/databases/uploads.md) to ClickHouse Cloud and self-hosted single-node ClickHouse deployments. Self-hosted clusters aren't supported.

For self-hosted deployments, the database user must be able to read the `system.clusters` table, as well as create tables and insert data.

## Danger zone

See [Danger zone](https://www.metabase.com/docs/latest/databases/danger-zone.md).
