Connecting DataGrip to ClickHouse

[Edit this page](https://github.com/ClickHouse/clickhouse-docs/blob/main/docs/integrations/sql-clients/datagrip.md)

Community Maintained

## Start or download DataGrip[​](#start-or-download-datagrip "Direct link to Start or download DataGrip")

DataGrip is available at <https://www.jetbrains.com/datagrip/>

## 1. Gather your connection details[​](#1-gather-your-connection-details "Direct link to 1. Gather your connection details")

To connect to ClickHouse with HTTP(S) you need this information:

|  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Parameter(s) Description|  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | | `HOST` and `PORT` Typically, the port is 8443 when using TLS or 8123 when not using TLS.|  |  |  |  | | --- | --- | --- | --- | | `DATABASE NAME` Out of the box, there is a database named `default`, use the name of the database that you want to connect to.| `USERNAME` and `PASSWORD` Out of the box, the username is `default`. Use the username appropriate for your use case. | | | | | | | |

The details for your ClickHouse Cloud service are available in the ClickHouse Cloud console.
Select a service and click **Connect**:

Choose **HTTPS**. Connection details are displayed in an example `curl` command.

If you're using self-managed ClickHouse, the connection details are set by your ClickHouse administrator.

## 2. Load the ClickHouse driver[​](#2-load-the-clickhouse-driver "Direct link to 2. Load the ClickHouse driver")

1. Launch DataGrip, and on the **Data Sources** tab in the **Data Sources and Drivers** dialog, click the **+** icon

Select **ClickHouse**

Tip

As you establish connections the order changes, ClickHouse may not be at the top of your list yet.

- Switch to the **Drivers** tab and load the ClickHouse driver

  DataGrip doesn't ship with drivers in order to minimize the download size. On the **Drivers** tab
  Select **ClickHouse** from the **Complete Support** list, and expand the **+** sign. Choose the **Latest stable** driver from the **Provided Driver** option:

## 3. Connect to ClickHouse[​](#3-connect-to-clickhouse "Direct link to 3. Connect to ClickHouse")

- Specify your database connection details, and click **Test Connection**.
  In step one you gathered your connection details - fill in the host URL, port, username, password, and database name, then test the connection.

Tip

Enter only the hostname in the **Host** field (e.g., `your-host.clickhouse.cloud`) without any protocol prefix like `https://`.

For ClickHouse Cloud connections, you must add `?ssl=true` to the **URL** field below the host. The complete JDBC URL should look like:

`jdbc:clickhouse://your-host.clickhouse.cloud:8443/default?ssl=true`

ClickHouse Cloud requires SSL encryption for all connections. Without the `?ssl=true` parameter, you'll see "Connection reset" errors even with correct credentials.

For more details on JDBC URL settings, please refer to the [ClickHouse JDBC driver](https://github.com/ClickHouse/clickhouse-java) repository.

## Learn more[​](#learn-more "Direct link to Learn more")

Find more information about DataGrip visit the DataGrip documentation.

- [Start or download DataGrip](#start-or-download-datagrip)- [1. Gather your connection details](#1-gather-your-connection-details)- [2. Load the ClickHouse driver](#2-load-the-clickhouse-driver)- [3. Connect to ClickHouse](#3-connect-to-clickhouse)- [Learn more](#learn-more)

Was this page helpful?