Claude Code + Codex · Installation
Build and deploy the complete service
Start from Git source. Deploy the dashboard, ClickHouse and its schema, and an OTel collection path before connecting coding clients.
Updated November 14, 2026 · Source-based instructions; verify the selected release and target environment.
Clone and build · Database schema · OTel backend · Hosting options · Client traces
What you must install
This guide does not depend on a published application .tar.gz. Clone the repository and build its Docker image. Optional device packages are generated by an installed dashboard; they do not install the backend.
| Component | Purpose and source |
|---|---|
| Dashboard application | dashboard/Dockerfile builds React and Express into one image, serving UI and API on port 8080. It does not run ClickHouse or an OTel Collector. |
| ClickHouse and schema | Persistent database, telemetry tables, materialized views and migration ledger. Select the single-node or replicated schema for your deployment. |
| OTel Collector | A separately running Collector receives logs, metrics and traces, applies the repository's filters and transforms, and writes to the prepared tables. |
| Authentication and secrets | OIDC or configured Basic authentication, HTTPS access, private database connectivity, separate reader/ingest/admin credentials and protected secret mounts. |
| Client collection | Claude Code/Codex exporters and a local Collector or organizer-managed collection path. Backend deployment does not change users' client settings. |
Install Git and Docker with buildx first. For EKS, also prepare the existing cluster dependencies, Terraform, AWS CLI and kubectl described in the organization deployment prerequisites.
1. Clone a release and build the image
Set CCDASH_RELEASE to an actual published vX.Y.Z release tag. Choose the platform to match your runtime; the supplied EKS deployment uses linux/arm64.
: "${CCDASH_RELEASE:?Set a published vX.Y.Z release tag}"
CCDASH_PLATFORM=linux/arm64
git clone https://github.com/Atom-oh/claude-code-usage-dashboard.git
cd claude-code-usage-dashboard
git checkout --detach "$CCDASH_RELEASE"
CCDASH_REVISION=$(git rev-parse HEAD)
docker build --platform "$CCDASH_PLATFORM" \
--build-arg APP_REVISION="$CCDASH_REVISION" \
--tag "ccdash:$CCDASH_RELEASE" dashboard
The build context is dashboard/, not the repository root. For an x86 runtime, select linux/amd64 and qualify that deployment separately. A build on a different architecture needs a configured cross-platform builder.
For production, follow the reviewed build, inspection, registry publication and rollout procedure. Preserve the release, source revision and image digest; do not treat a successful local build as deployment.
2. Prepare ClickHouse before starting ingestion
Provision persistent ClickHouse storage and backup/recovery first. Create a read-only dashboard account, an ingestion account with the required exporter grants, and an administrative migration account. The schema file does not provision your production users.
The supplied account policy grants otel_reader SELECT on claude_code.*. The otel_ingest account needs INSERT on claude_code.* and SELECT on claude_code.otel_metrics_sum for the materialized-view source read; INSERT alone can fail ingestion. Restrict account networks and configure protected credentials using the repository's ClickHouse account policy as the reference.
| Deployment | Schema path |
|---|---|
| Fresh single node / local evaluation | clickhouse-schema.sql: non-replicated tables, views, rollups and current migration guards. It includes Claude telemetry and dedicated Codex metric/cost/diagnostic tables. |
| Fresh replicated EKS installation | infra/files/clickhouse-schema-replicated.sql with the generated contract and schema-init Job in infra/schema.tf. Requires the declared cluster/Keeper topology and expected replicas. |
| Existing installation | Inspect tables, ledger and historical data. Apply only the required numbered migrations following their runbooks; do not replay bootstrap as an upgrade. |
For EC2/Docker, prepare these prerequisites before starting ClickHouse:
- A private bridge network and persistent data volume.
- Protected
users.dXML for the reader, ingest and admin accounts, restricted networks, disabled anonymous default access and an admin client configuration. - A qualified, digest-pinned ClickHouse image; the local Compose version is a starting reference.
CLICKHOUSE_SKIP_USER_SETUP=1 retains that account configuration. Validate its authentication and network restrictions first. This command leaves database ports unpublished:
: "${CCDASH_NETWORK:?Set the prepared private Docker network}"
: "${CCDASH_CH_CONTAINER:?Set the ClickHouse container name}"
: "${CCDASH_CH_IMAGE:?Set the reviewed ClickHouse image including its sha256 digest}"
: "${CCDASH_CH_DATA_VOLUME:?Set the prepared persistent data volume}"
: "${CCDASH_CH_USERS_DIR:?Set the protected users.d configuration directory}"
: "${CCDASH_CH_ADMIN_CONFIG:?Set the protected admin client configuration file}"
docker run -d --name "$CCDASH_CH_CONTAINER" --restart unless-stopped \
--network "$CCDASH_NETWORK" --network-alias clickhouse.internal \
--env CLICKHOUSE_SKIP_USER_SETUP=1 \
--mount "type=volume,src=$CCDASH_CH_DATA_VOLUME,dst=/var/lib/clickhouse" \
--mount "type=bind,src=$CCDASH_CH_USERS_DIR,dst=/etc/clickhouse-server/users.d,readonly" \
--mount "type=bind,src=$CCDASH_CH_ADMIN_CONFIG,dst=/run/ccdash-admin/client.xml,readonly" \
"$CCDASH_CH_IMAGE"
Wait for ClickHouse startup and authenticate with the mounted admin client configuration. For the schema command below, its container path is /run/ccdash-admin/client.xml. Use clickhouse.internal as the database host for the app and Collector on this network. The image and mounted configurations must match the runtime architecture and file-read permissions.
For a new, empty, non-replicated database, set CCDASH_CH_CONTAINER to its running ClickHouse container and CCDASH_CH_CLIENT_CONFIG to the protected admin client configuration path inside it.
: "${CCDASH_CH_CONTAINER:?Set the prepared ClickHouse container name}"
: "${CCDASH_CH_CLIENT_CONFIG:?Set the mounted admin client configuration path}"
docker exec -i "$CCDASH_CH_CONTAINER" \
clickhouse-client --config-file "$CCDASH_CH_CLIENT_CONFIG" \
--multiquery < clickhouse-schema.sql
docker exec "$CCDASH_CH_CONTAINER" clickhouse-client \
--config-file "$CCDASH_CH_CLIENT_CONFIG" \
--query "SELECT name FROM system.tables WHERE database='claude_code' ORDER BY name"
Verify otel_logs, otel_traces, Claude metric tables, all four Codex metric tables, views and schema_migrations. The Collector uses create_schema: false; it cannot fill in missing tables. Migration 003 requires a statement-by-statement rollup cutover. Typed read activation also requires verified history/live coverage, not just table existence.
The existing dashboard/docker-compose.yml initializes a fresh local ClickHouse volume and synthetic seed data. It uses development authentication and has no OTel Collector service. It is an evaluation starting point, not a complete production install; existing volumes are not reinitialized.
Schema lifecycle and migration ordering · Codex cost read activation
3. Install the OTel backend
Run a Collector distribution that includes the ClickHouse exporter and the required processors. For the optional device-token path, dashboard/collector/generated/central.yaml is the repository's private central receiver policy; use the reviewed, digest-pinned Contrib image from infra/device_ingest.tf.
- Mount the central YAML as the Collector config. Set
CH_HOST,CH_PORT(native port),CH_DB=claude_code,CH_USERand matchingCLAUDE_ENABLED/CODEX_ENABLEDflags. - Mount the ClickHouse ingest credential at
/var/run/ccdash-clickhouse/CH_PASSWORDand the internal receiver bearer token at/var/run/ccdash-ingest/token, read-only. Ensure the container user can read them. Do not distribute this internal token to clients. - Keep receiver port 4318 and health port 13133 private. The generated central policy uses OTLP HTTP with bearer authentication and a private native ClickHouse connection. Cross-boundary connections require the appropriate TLS policy.
- Enable all required pipelines: Claude metrics/logs/traces and Codex metrics/logs/traces. Codex metric pipelines write to their dedicated tables; logs and traces use the shared tables with retained client identity.
- For device ingestion, configure the dashboard's OIDC gate, DynamoDB device registry, runtime IAM permissions,
INGEST_ENABLED=1,INGEST_TOKEN_TABLE,INGEST_UPSTREAM_URLandINGEST_UPSTREAM_TOKEN_FILE. The backend forwards authenticated devices to the private receiver.
For organizer-managed clients, collector-config.yaml and user-data.sh describe a separate local-Collector-to-ClickHouse path with deployment-specific credentials and endpoints. Do not combine the two paths by copying a configuration unchanged.
On an EC2/Docker host, prepare a private Docker network with access to ClickHouse, a nonsecret Collector environment file, and the two protected secret files. Select the digest-pinned image from infra/device_ingest.tf; the files must be readable by that image's runtime user. The central receiver is reachable by the dashboard on this network; no OTLP or health port is published to the host:
: "${CCDASH_NETWORK:?Set the existing private Docker network}"
: "${CCDASH_COLLECTOR_IMAGE:?Set the pinned contrib image including its sha256 digest}"
: "${CCDASH_COLLECTOR_ENV_FILE:?Set the prepared nonsecret Collector environment file}"
: "${CCDASH_INGEST_SECRET_DIR:?Set the protected directory containing token}"
: "${CCDASH_INGEST_CH_SECRET_DIR:?Set the protected directory containing CH_PASSWORD}"
docker run -d --name ccdash-otel --restart unless-stopped \
--network "$CCDASH_NETWORK" \
--env-file "$CCDASH_COLLECTOR_ENV_FILE" \
--mount "type=bind,src=$PWD/dashboard/collector/generated/central.yaml,dst=/etc/otelcol-contrib/config.yaml,readonly" \
--mount "type=bind,src=$CCDASH_INGEST_SECRET_DIR,dst=/var/run/ccdash-ingest,readonly" \
--mount "type=bind,src=$CCDASH_INGEST_CH_SECRET_DIR,dst=/var/run/ccdash-clickhouse,readonly" \
"$CCDASH_COLLECTOR_IMAGE" --config=/etc/otelcol-contrib/config.yaml
For this network, set the app's upstream to http://ccdash-otel:4318 and mount the same internal bearer token at INGEST_UPSTREAM_TOKEN_FILE. This token differs from each user's device token. The supplied central queue is in memory; design persistence/retry and loss monitoring for your operating requirements.
Central receiver and device registry setup · Central Collector configuration · Organizer-managed collection
4. Configure and start the dashboard
Provide the database connection and authentication settings before starting the image. The following is a nonsecret configuration template; replace the example endpoint, issuer, client ID and group names with your deployment values.
CH_URL=http://clickhouse.internal:8123
CH_DB=claude_code
CH_USER=otel_reader
CH_PASSWORD_FILE=/run/ccdash-secrets/CH_PASSWORD
CLAUDE_ENABLED=true
CODEX_ENABLED=true
AUTH_MODE=oidc
APP_PUBLIC_URL=https://dashboard.example.com
OIDC_ISSUER=https://issuer.example.com
OIDC_CLIENT_ID=YOUR_APP_CLIENT_ID
OIDC_ROLE_GROUPS={"viewer":["YOUR_VIEWER_GROUP"],"analyst":["YOUR_ANALYST_GROUP"],"admin":["YOUR_ADMIN_GROUP"]}
OIDC_CLIENT_SECRET_FILE=/run/ccdash-secrets/OIDC_CLIENT_SECRET
SESSION_SECRET_FILE=/run/ccdash-secrets/SESSION_SECRET
Prepare secrets before starting the dashboard:
- Provision the three referenced files through the platform's secret mechanism and mount them read-only.
- Use a base64url-encoded 32-byte random key for
SESSION_SECRET. Preserve exact content and read permissions for the non-rootnodeuser. - On EC2, retain the configured absolute container paths. On ECS/EKS, provide the corresponding task/pod secret delivery.
Keep insecure development authentication disabled for public deployments.
After preparing CCDASH_ENV_FILE and CCDASH_SECRET_DIR on an EC2/Docker host, this runs the app behind a separately configured HTTPS reverse proxy:
: "${CCDASH_RELEASE:?Set the built release tag}"
: "${CCDASH_ENV_FILE:?Set the prepared nonsecret environment file}"
: "${CCDASH_SECRET_DIR:?Set the runtime-readable protected secret directory}"
: "${CCDASH_NETWORK:?Set the existing private Docker network}"
docker run -d --name ccdash --restart unless-stopped \
--network "$CCDASH_NETWORK" \
--publish 127.0.0.1:8080:8080 \
--env-file "$CCDASH_ENV_FILE" \
--mount "type=bind,src=$CCDASH_SECRET_DIR,dst=/run/ccdash-secrets,readonly" \
"ccdash:$CCDASH_RELEASE"
To enable device ingestion, also add the internal token file mount and INGEST_* settings from the previous step to the app's runtime configuration. This base app command does not configure the device registry or enable ingestion by itself.
Choose EC2, ECS, EKS or adapt the app for Lambda
| Option | Deployment shape | Repository support and remaining work |
|---|---|---|
| EC2 + Docker | Run the dashboard, a Collector, and persistent ClickHouse on private hosts or networks. Use durable database/queue storage and an HTTPS entry point. | The app image and single-node schema are supplied. Prepare host/service lifecycle, secrets, database users, network routing and backups yourself. The workshop user-data script configures client collection, not this whole backend. |
| ECS / Fargate | Publish the app and Collector images to ECR; run separate services or appropriate sidecars. Use private networking and a separately managed persistent ClickHouse installation. | No ECS task/service templates are supplied. Define task/execution roles, secret delivery, CPU/memory, image architecture, health checks and service connectivity. Do not rely on an ephemeral task filesystem for the database or durable queues. |
| EKS | Use the existing cluster, ClickHouse/Keeper operators and persistent volumes; deploy app and optional central receiver with the repository's Terraform. | infra/ reuses a cluster/VPC. Prepare operators, Karpenter, CSI/storage, DNS/certificates, IAM and secrets, then plan/apply, verify schema-init, publish the reviewed image and roll out. It does not create every prerequisite. |
| Lambda | Port the HTTP application to a Lambda-compatible runtime/adapter. Keep ClickHouse and ingestion Collector on persistent external services. | The current Docker image starts Express and has no Lambda handler/runtime integration. No ready-made Lambda deployment is supplied. Validate auth cookies, streaming/chat, timeouts, networking and device ingestion after adaptation; selecting Lambda alone does not install this stack. |
Official platform references: EC2 · ECS/Fargate task definitions · EKS application deployment · Lambda image/runtime requirements.
5. Connect client logs, metrics and traces
After the backend works, configure each client's local Collector and exporter destination. For the device path, an analyst/admin can register a device in the deployed dashboard. Choose the device’s platform, register it and copy the installation command. The terminal asks for the telemetry attribution ID and device token; the token is not embedded in the command. An installed backend and issued device token are required.
Device installation
macOS
: "${CCDASH_DASHBOARD_URL:?Set the deployed HTTPS dashboard origin}"
curl -fsSL "$CCDASH_DASHBOARD_URL/api/ingest/install.sh" | sh
Linux
: "${CCDASH_DASHBOARD_URL:?Set the deployed HTTPS dashboard origin}"
sudo loginctl enable-linger "$USER" &&
curl -fsSL "$CCDASH_DASHBOARD_URL/api/ingest/install.sh" | sh
The script downloads the package with the device bearer token, then invokes the installer using a private token file. The device token does not authorize interactive dashboard login.
Manual source fallback
: "${CCDASH_INGEST_ENDPOINT:?Set the deployed HTTPS dashboard URL ending in /api/ingest}"
: "${CCDASH_USER_ID:?Set the intended telemetry attribution ID}"
python3 dashboard/collector/install.py install \
--endpoint "$CCDASH_INGEST_ENDPOINT" --user-id "$CCDASH_USER_ID"
The installer requires Python 3.9+ on macOS/Linux and prompts privately for the token. On Linux, run sudo loginctl enable-linger "$USER" for service persistence after logout/reboot, then install as your normal user. It downloads and verifies the Collector binary; this command does not provision the dashboard, database or central receiver. A device owner is not automatically the emitted telemetry identity.
- Claude Code:
CLAUDE_CODE_ENABLE_TELEMETRY=1andCLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1,OTEL_TRACES_EXPORTER=otlp, local OTLP gRPC destination on port 4317. - Codex: separate
[otel]exporter,metrics_exporterandtrace_exporterentries; local OTLP HTTP destinations on port 4318 andlog_user_prompt=false.
Restart both clients, generate new work, and follow user → selected time range → task → Task Trace. Earlier activity is not backfilled into traces. For Codex diagnostic spans, open Analytics' Trace tab.
Existing devices and databases
Preserve private client backups and exporter queues during device migration. Follow the supported macOS/Linux migration procedure instead of stopping an unknown service. Database upgrades follow the schema runbook independently of client installation and application rollout.
6. Verify every boundary
- Check
/healthzand ClickHouse-backed/readyz, then authenticate and inspect the installation/schema diagnostics. - Confirm expected tables, migration ledger, views, database grants and Collector write success; schema existence alone is not historical data readiness.
- Send fresh client work and verify stored logs, metrics and traces under the intended identity. A Collector process or device receipt does not prove persistence.
- Check the selected user's usage and Task Trace. Codex trace/metric observations are diagnostics and must not add another cost total.
Organizer-prepared workshops
A prepared workshop has its own client and Collector lifecycle. Participants use the configured environment; they do not deploy a second backend or install another Collector over the prepared service. Organizers must supply the schema, secret destination and bootstrap assets before using user-data.sh.