chmonitor
Deployment

Self-host (Node / standalone)

Run chmonitor on any server using Node.js — bare VMs, dedicated servers, or any environment where you manage the process directly.

Run chmonitor on any server using Node.js — best for bare VMs, dedicated servers, or any environment where you manage the process directly.

Prerequisites

  • Node.js and pnpm (pnpm@10.18.0, via corepack) installed on the server.
  • A reachable ClickHouse endpoint with a monitoring user.
  • A process supervisor (systemd) and, optionally, a reverse proxy (nginx).

Setup

Clone and install

git clone https://github.com/chmonitor/chmonitor.git
cd chmonitor
pnpm install

Set credentials

export CLICKHOUSE_HOST='https://clickhouse.example.com:8443'
export CLICKHOUSE_USER='monitoring'
export CLICKHOUSE_PASSWORD='change-me'

Build and start

pnpm run build
pnpm run start

Open http://localhost:3000.

Using .env

Put env vars in apps/dashboard/.env.local. Never commit credentials.

cat <<'EOF' > apps/dashboard/.env.local
CLICKHOUSE_HOST=https://clickhouse.example.com:8443
CLICKHOUSE_USER=monitoring
CLICKHOUSE_PASSWORD=change-me
EOF

pnpm run start

Verify

curl -sf http://localhost:3000/api/healthz && echo OK

Configure

Required:

CLICKHOUSE_HOST=https://clickhouse.example.com:8443
CLICKHOUSE_USER=monitoring
CLICKHOUSE_PASSWORD=change-me

Put them in apps/dashboard/.env.local. Template: apps/dashboard/.env.example. Full list: Environment variables.

systemd unit

[Unit]
Description=chmonitor ClickHouse dashboard
After=network.target

[Service]
Type=simple
User=chmonitor
WorkingDirectory=/opt/chmonitor
EnvironmentFile=/etc/chmonitor/env
ExecStart=/usr/local/bin/pnpm run start
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target

Create /etc/chmonitor/env:

CLICKHOUSE_HOST=https://clickhouse.example.com:8443
CLICKHOUSE_USER=monitoring
CLICKHOUSE_PASSWORD=change-me
CHM_AUTH_PROVIDER=none

Enable and start:

systemctl enable --now chmonitor

Upgrading

cd /opt/chmonitor
git pull
pnpm install
pnpm run build
systemctl restart chmonitor

For breaking changes between major versions, see Migrating to v0.3.

On this page