
## Set up ClickHouse

URL: https://docs.atlan.com/apps/connectors/database/clickhouse/how-tos/set-up-clickhouse

> Configure a dedicated ClickHouse user with read-only access so Atlan can connect and extract metadata.

Create a dedicated ClickHouse user with read-only access so Atlan can connect to your instance and extract metadata. You do this by running SQL in ClickHouse to create the user and grant the required permissions.

## Prerequisites

Before you begin, make sure you have:

* A ClickHouse administrator to run the SQL commands (or access to run SQL on your ClickHouse instance)
* The HTTPS interface port (default `8443`) accessible from Atlan, or a plan to use [Self-Deployed Runtime](https://docs.atlan.com/llms/connectors/clickhouse/how-atlan-connects-to-clickhouse/llms.txt) for instances behind a firewall

## Create read-only user

Create a dedicated user in ClickHouse for Atlan and grant it the permissions needed for metadata extraction and, if needed, preview and query. 

1. Connect to your ClickHouse instance.

2. Run the following command to create the user:

 ```sql
 CREATE USER {{username}} IDENTIFIED BY '{{password}}';
 ```
 - Replace `{{username}}` and `{{password}}` with the username and password you want for the new user.

3. Run the following command to grant permissions. 

 ```sql
 GRANT SELECT ON system.databases TO {{username}};
 GRANT SELECT ON system.tables TO {{username}};
 GRANT SELECT ON system.columns TO {{username}};
 GRANT SELECT ON *.* TO {{username}};
 ```
 - Replace `{{username}}` with the username you created.

 The `SELECT ON *.*` grant enables preview and query in Atlan; omit it if you don't need that. Atlan uses these permissions to discover databases, read table and view metadata (row counts, engine types, partition keys, view definitions), and read column metadata. 

## Next steps

* [Crawl ClickHouse assets](https://docs.atlan.com/llms/connectors/clickhouse/crawl-clickhouse/llms.txt): Connect Atlan to ClickHouse and catalog your data assets.

---
