clickhouse profile. For production deployments, we recommend moving ClickHouse to a dedicated instance or managed service for better data redundancy and independent scaling.
Option 1: Standalone ClickHouse via Docker
Run ClickHouse on a separate machine using Docker:- Port 8123 — HTTP interface (used by the Datawizz app and logging services)
- Port 9000 — Native TCP interface (used by the PostgreSQL FDW and migrations)
Option 2: Managed ClickHouse Service
You can use a managed ClickHouse provider such as ClickHouse Cloud or any other hosted ClickHouse offering. Ensure the service exposes both HTTP and native TCP interfaces, and note the connection credentials for the next step.Updating the Main Instance
Once your external ClickHouse is running, update the.env file on your main Datawizz instance:
1. Set the ClickHouse connection variables
| Variable | Description | Default |
|---|---|---|
CLICKHOUSE_HOST | Hostname or IP of the external ClickHouse server | clickhouse (local container) |
CLICKHOUSE_PORT | HTTP port | 8123 |
CLICKHOUSE_NATIVE_PORT | Native TCP port (used by FDW and migrations) | 9000 |
CLICKHOUSE_USER | ClickHouse username | default |
CLICKHOUSE_PASSWORD | ClickHouse password | default |
CLICKHOUSE_DATABASE | Database name | default |
2. Disable the local ClickHouse profile
Do not use theclickhouse or full profile when starting services. Instead, start with only the profiles you need:
If you previously ran with the
clickhouse profile, the local container may still exist. You can remove it with docker compose --profile clickhouse down.3. Run database migrations
The ClickHouse migrations need to run against your external instance. You can trigger them manually:CLICKHOUSE_HOST, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD, and CLICKHOUSE_DATABASE env vars from your .env file. Check the logs to confirm success: