> For the complete documentation index, see [llms.txt](https://docs.wobby.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wobby.ai/connections/connect-a-data-source/clickhouse.md).

# ClickHouse

### Connect ClickHouse to Actian AI Analyst

To connect your ClickHouse instance to Actian AI Analyst, follow these steps:

* Create a read-only user account.
* Grant read-only access to the necessary databases.
* Allow Actian AI Analyst's IP address through your firewall or network rules.
* Set up the connection in the Actian AI Analyst interface.

⚠️ Actian AI Analyst's agents only run **read-only queries** on your data. No write or administrative privileges are required.

***

#### 1. Create a Read-Only User in ClickHouse

Create a dedicated ClickHouse user that Actian AI Analyst will use to query your data.

```sql
-- Replace with your chosen username and a secure password
CREATE USER analyst_user IDENTIFIED BY 'your_secure_password';
```

✅ Use a strong password and avoid reusing credentials from other systems.

***

#### 2. Grant Read-Only Access to Data

Grant the user read-only (`SELECT`) access to the databases Actian AI Analyst should be able to analyze.

```sql
-- Grant SELECT on all tables in a specific database
GRANT SELECT ON your_database.* TO analyst_user;
```

🔐 Repeat for each database Actian AI Analyst should have access to. If you want finer control, you can grant access on a per-table basis:

```sql
GRANT SELECT ON your_database.orders TO analyst_user;
GRANT SELECT ON your_database.customers TO analyst_user;
```

✅ Actian AI Analyst will only query data the user has access to—if the user doesn't have access, Actian AI Analyst won't either.

***

#### 3. Allow Actian AI Analyst's IP Address

If your ClickHouse server is protected by firewall or network rules, allow inbound traffic from Actian AI Analyst's static IP:

```
34.77.172.158
```

> This is required for Actian AI Analyst's agents to connect to your ClickHouse instance.

***

#### 4. Set Up the Connection in Actian AI Analyst

1. Click **Connections → Plus button → Select ClickHouse**.
2. Fill in the following details:
   * **Host**: your ClickHouse server hostname or IP address
   * **Port**: default is `8123` (HTTP) or `8443` (HTTPS/SSL) — leave as default unless your instance uses a custom port
   * **Database**: the default database Actian AI Analyst should connect to
   * **Database schemas**: select the databases Actian AI Analyst is allowed to query
   * **Username**: `analyst_user`
   * **Password**: the secure password you set
   * **SSL**: enable if your ClickHouse instance requires encrypted connections
3. Test the connection and click **Save**.

> 📌 **ClickHouse Cloud users**: If your host ends in `.clickhouse.cloud`, Actian AI Analyst will automatically enable SSL and switch the port to `8443`.

***

#### That's It!

Actian AI Analyst is now connected to ClickHouse. You can start asking questions in natural language—no dashboards, no SQL—just insights.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.wobby.ai/connections/connect-a-data-source/clickhouse.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
