Skip to content

Self-hosting ​

Eureka Analytics runs on your own infrastructure as a set of containers. Every component is stateless except ClickHouse (analytics data), PostgreSQL (accounts and settings) and Redpanda/Kafka (the event log), which can be self-hosted or replaced by managed services.

Components ​

ServiceRolePort
collectorReceives tag and server hits (/v1/c, /v1/p.gif, /v1/s, /v1/config/{pid}.json)8080
processorClassifies actors, builds sessions, writes to ClickHouse in batches—
apiAdmin and reporting API, public API v1, prompt reporting3000 (container 8080)
uiWeb app5173 (container 80)
tag-cdnServes ah.js8081
clickhouse, postgres, redpandaStorage and event log8123, —, 19092

Single server with Docker Compose ​

bash
cp deploy/.env.example deploy/.env      # set every secret
docker compose -f deploy/docker-compose.yml --env-file deploy/.env up -d --build
# Collector http://localhost:8080 · Tag http://localhost:8081/ah.js · API http://localhost:3000 · App http://localhost:5173

The ClickHouse schema is created on first start. The API applies the PostgreSQL migrations on start.

With the demo data ​

bash
docker compose -f deploy/docker-compose.yml --env-file deploy/.env --profile demo up -d --build
# then open http://localhost:5173/demo

The demo-data service generates 120 days of Summit Supply traffic (about 3.8 million events) the first time, then keeps generating live traffic.

Kubernetes ​

bash
kubectl create namespace ah
kubectl -n ah apply -k deploy/k8s

The manifests deploy the collector (with a horizontal autoscaler, 3 to 60 pods), the processor (keep replicas at or below the number of Kafka partitions, 12 by default), the API, the app, the tag CDN, the demo traffic and an ingress for three hostnames (collect., cdn., app.). ClickHouse, Kafka and PostgreSQL are expected to be managed services (ClickHouse Cloud or the Altinity operator, Redpanda Cloud or MSK, Cloud SQL or RDS); set their URLs in the secret (deploy/k8s/secret.example.yaml, to replace with your secret manager).

Environment variables ​

Main settings in deploy/.env:

VariablePurpose
CLICKHOUSE_PASSWORD, POSTGRES_PASSWORDDatabase passwords
JWT_SECRETSigns app sessions (32+ characters)
AH_IP_SALT_SECRETDerives the daily salts used to hash IPs and cookieless visitor IDs. Required in production.
ANTHROPIC_API_KEYEnables questions in plain English (Claude). AH_DISABLE_ASK=1 turns the feature off. AH_ANTHROPIC_MODEL and AH_ANTHROPIC_EFFORT tune it.
AH_INTERNAL_TOKENProtects internal endpoints (collection status)
STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRET, STRIPE_PRICE_<PLAN>_<PERIOD>Billing. Without them, plan changes apply immediately (development mode).
DEMO_ENABLED, DEMO_ASK_PER_HOUR, DEMO_ASK_DAILY_CAPPublic demo

Collector and processor (AH_ variables):

VariableDefaultPurpose
AH_MODEstandalonecollector, processor or standalone (both in one process, no Kafka: for small installs)
AH_PROPERTIES_FILEproperties.yamlProperties, allowed hostnames, ingest keys, tag configuration. Reload with SIGHUP.
AH_KAFKA_BROKERSlocalhost:9092Kafka / Redpanda brokers
AH_CLICKHOUSE_DSNclickhouse://default:@localhost:9000/ahClickHouse (native protocol)
AH_TRUST_PROXY_HEADERSfalseRead the client IP from CF-Connecting-IP / X-Forwarded-For behind a load balancer or CDN
AH_GEOIP_CITY_DB, AH_GEOIP_ASN_DB—MaxMind databases for geography and network
AH_FETCH_IP_RANGEStrueDownload the bots' published IP ranges daily
AH_FLUSH_INTERVAL, AH_FLUSH_MAX_ROWS1s, 50000Batch size of database writes
AH_SESSION_TIMEOUT30mServer-side session split

Scaling ​

  • The collector handles tens of thousands of requests per second per vCPU and scales horizontally.
  • The processor scales with the Kafka partitions; events of a visitor stay in order within a partition.
  • ClickHouse scales by shards (by property) and replicas; one cluster per region keeps data in its region.

Agents & humans, every visit counts!