Connect ClickHouse to Deepnote

[Edit this page](https://github.com/ClickHouse/clickhouse-docs/blob/main/docs/integrations/data-visualization/community_integrations/deepnote.md)

Community Maintained

[Deepnote](https://www.deepnote.com/) is a collaborative data notebook built for teams to discover and share insights. In addition to being Jupyter-compatible, it works in the cloud and provides you with one central place to collaborate and work on data science projects efficiently.

This guide assumes you already have a Deepnote account and that you have a running ClickHouse instance.

## Interactive example[​](#interactive-example "Direct link to Interactive example")

If you would like to explore an interactive example of querying ClickHouse from Deepnote data notebooks, click the button below to launch a template project connected to the [ClickHouse playground](/docs/getting-started/playground).

[![Launch in Deepnote](https://deepnote.com/buttons/launch-in-deepnote.svg)](https://deepnote.com/launch?template=ClickHouse%20and%20Deepnote)

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

1. Within Deepnote, select the "Integrations" overview and click on the ClickHouse tile.

2. Provide the connection details for your ClickHouse instance:

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.

***NOTE:*** If your connection to ClickHouse is protected with an IP Access List, you might need to allow Deepnote's IP addresses. Read more about it in [Deepnote's docs](https://docs.deepnote.com/integrations/authorize-connections-from-deepnote-ip-addresses).

3. Congratulations! You have now integrated ClickHouse into Deepnote.

## Using ClickHouse integration.[​](#using-clickhouse-integration "Direct link to Using ClickHouse integration.")

1. Start by connecting to the ClickHouse integration on the right of your notebook.
2. Now create a new ClickHouse query block and query your database. The query results will be saved as a DataFrame and stored in the variable specified in the SQL block.
3. You can also convert any existing [SQL block](https://docs.deepnote.com/features/sql-cells) to a ClickHouse block.

- [Interactive example](#interactive-example)- [Connect to ClickHouse](#connect-to-clickhouse)- [Using ClickHouse integration.](#using-clickhouse-integration)

Was this page helpful?