| name | clickhouse-install-auth |
| description | Install @clickhouse/client and configure authentication to ClickHouse Cloud
or self-hosted. Use when setting up a new ClickHouse project, configuring
connection strings, or initializing the official Node.js or Python client.
Trigger with "install clickhouse", "setup clickhouse client", "clickhouse
auth", "connect to clickhouse", "clickhouse credentials".
|
| allowed-tools | Read, Write, Bash(npm:*), Bash(pnpm:*), Bash(pip:*) |
| version | 1.7.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","database","analytics","clickhouse","olap"] |
| compatibility | Designed for Claude Code |
ClickHouse Install & Auth
Overview
Set up the official ClickHouse client for Node.js or Python and configure
authentication to ClickHouse Cloud or a self-hosted instance. The workflow
below is the high-level path; each step links to a full walkthrough with
complete code in references/implementation.md.
Prerequisites
- Node.js 18+ or Python 3.8+
- A running ClickHouse instance (Cloud or self-hosted)
- Connection credentials (host, port, user, password)
Instructions
Follow these five steps. Read the current project for an existing .env before
writing one; write credentials to .env (never commit it).
-
Install the official client. Node.js uses the HTTP-based
@clickhouse/client; Python uses clickhouse-connect.
npm install @clickhouse/client
pip install clickhouse-connect
-
Configure environment variables. Put host, user, and password in .env
and add it to .gitignore. Cloud hosts use port 8443 (HTTPS); self-hosted
uses 8123 (HTTP).
-
Create the client. Pass url, username, and password to
createClient() (Node.js) or get_client() (Python). Cloud requires TLS —
supply an https:// URL and the client handles it.
import { createClient } from '@clickhouse/client';
const client = createClient({
url: process.env.CLICKHOUSE_HOST,
username: process.env.CLICKHOUSE_USER,
password: process.env.CLICKHOUSE_PASSWORD,
});
-