Skip to main content
clickhousectl is the CLI for ClickHouse: local and cloud. With clickhousectl you can:
  • Install and manage local ClickHouse versions
  • Launch and manage local ClickHouse servers
  • Execute queries against ClickHouse servers
  • Set up ClickHouse Cloud and create cloud-managed ClickHouse clusters
  • Manage ClickHouse Cloud resources
  • Install the official ClickHouse agent skills into supported coding agents
  • Push your local ClickHouse development to cloud
clickhousectl helps humans and AI-agents to develop with ClickHouse.

Installation

Quick install

The install script downloads the correct version for your OS and installs to ~/.local/bin/clickhousectl. A chctl alias is also created automatically for convenience.

Requirements

Local

Installing and managing ClickHouse versions

clickhousectl downloads ClickHouse binaries from GitHub releases.

ClickHouse binary storage

ClickHouse binaries are stored in a global repository, so they can be used by multiple projects without duplicating storage. Binaries are stored in ~/.clickhousectl/:

Initializing a project

init bootstraps your current working directory with a standard folder structure for your ClickHouse project files. It is optional; you are welcome to use your own folder structure if preferred. It creates the following structure:

Running queries

Creating and managing ClickHouse servers

Start and manage ClickHouse server instances. Each server gets its own isolated data directory at .clickhousectl/servers/<name>/data/.
Server naming: Without --name, the first server is called “default”. If “default” is already running, a random name is generated (e.g. “bold-crane”). Use --name for stable identities you can start/stop repeatedly. Ports: Defaults are HTTP 8123 and TCP 9000. If these are already in use, free ports are automatically assigned and shown in the output. Use --http-port and --tcp-port to set explicit ports.

Project-local data directory

All server data lives inside .clickhousectl/ in your project directory:
Each named server has its own data directory, so servers are fully isolated from each other. Data persists between restarts — stop and start a server by name to pick up where you left off. Use clickhousectl local server remove <name> to permanently delete a server’s data.

Authentication

Authenticate to ClickHouse Cloud using OAuth (browser-based) or API keys.

OAuth login (recommended)

This opens your browser for authentication via the OAuth device flow. Tokens are saved to .clickhousectl/tokens.json (project-local).

API key/secret

Credentials are saved to .clickhousectl/credentials.json (project-local). You can also use environment variables:
Or pass credentials directly via flags on any command:

Auth status and logout

Credential resolution order: CLI flags > OAuth tokens > .clickhousectl/credentials.json > environment variables.

Cloud

Manage ClickHouse Cloud services via the API.

Organizations

Services

Service create options

Query endpoint management

Private endpoint management

Backup configuration

Backups

Members

Invitations

Keys

Activity

JSON output

Use the --json flag to print JSON-formatted responses.

Skills

Install the official ClickHouse Agent Skills from ClickHouse/agent-skills.

Non-interactive flags

Last modified on June 19, 2026