
Deploy OpenPanel | (Just Updated) Open-Source Mixpanel Alternative, Admin Login Pre-Created, Sign-up Closed
OpenPanel web and product analytics, Mixpanel alternative, login included
dashboard
Just deployed
cache
Just deployed
/data
clickhouse
Just deployed
/var/lib/clickhouse
openpanel
Just deployed
Just deployed
database
Just deployed
/var/lib/postgresql
Deploy and Host OpenPanel on Railway
Built for an LLM agent to deploy and use. The deploy form has no fields to fill: the owner login, every secret and the three databases' credentials are generated, the first account is created before the site is reachable, and nobody else can register. OpenPanel is an open-source web and product analytics platform with funnels, retention, a live view and an event API, a self-hosted alternative to Mixpanel and Google Analytics.
About Hosting OpenPanel
This template runs six services: openpanel, the official lindesvard/openpanel-api image (release 2.3.0) pinned by digest through a thin wrapper, which owns the one public domain on port 8080 with an HTTP healthcheck at /api/healthcheck; dashboard, the stock OpenPanel dashboard; worker, the stock background worker; database, PostgreSQL 17 with a volume at /var/lib/postgresql; cache, Redis with a volume at /data; and clickhouse, ClickHouse 25.10 with a volume at /var/lib/clickhouse, where the events live.
What the wrapper fixes. Stock OpenPanel makes whoever reaches the sign-up form first the owner, and it is three separate web services that a visitor reaches on different addresses. The wrapper runs the database migrations, creates the owner account from ADMIN_EMAIL and ADMIN_PASSWORD before the public port opens, keeps registration closed afterwards, and serves one public port: /api goes to the API, everything else to the dashboard over the private network, the same split upstream's own Caddy file makes. The deploy is signed up for and closed to strangers before the first healthcheck turns green. Redeploys keep the owner, the projects and the events.
Using it. Open your domain, sign in with the owner e-mail and password, and create a project; the dashboard shows the client id and secret to put in an OpenPanel SDK. An agent can do the same through the API as below. Send events to POST /api/track with the openpanel-client-id and openpanel-client-secret headers. E-mail (invites, the weekly digest) and OAuth sign-in are not configured; set their variables on the openpanel service if you need them.
Agent contract
- Public URL:
https://RAILWAY_PUBLIC_DOMAIN(the generated domain of theopenpanelservice) - Private URL:
http://openpanel.railway.internal:3000(the API; the dashboard answers onhttp://dashboard.railway.internal:8080) - Credentials: the variables
ADMIN_EMAILandADMIN_PASSWORDon theopenpanelservice (plain text); the event client id and secret are created after sign-in - Auth:
POST /api/trpc/auth.signInEmailwith a JSON body of email and password wrapped in ajsonobject sets a session cookie;POST /api/trpc/onboarding.projectwith that cookie creates a project and returns a write client id and secret, sent as theopenpanel-client-idandopenpanel-client-secretheaders onPOST /api/track, which answers 401 without them - Health:
GET /api/healthcheckreturns 200 without credentials
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_EMAIL, ADMIN_PASSWORD (variables of the openpanel service); also curl, jq.
R="https://$RAILWAY_PUBLIC_DOMAIN"; H="content-type: application/json"; JAR=$(mktemp)
NOPE="not-the-real-one-1"
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/api/healthcheck")" = 200 ]; do n=$((n+1)); [ "$n" -le 90 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/api/healthcheck"
# the owner exists already and registration is closed: a stranger's sign-up is refused
curl -s -o /dev/null -w "public signup: %{http_code}\n" -H "$H" -d "$(jq -nc --arg p "$NOPE" '{json:{firstName:"X",lastName:"Y",email:"stranger@example.com",password:$p,confirmPassword:$p}}')" "$R/api/trpc/auth.signUpEmail"
curl -s -o /dev/null -w "wrong login: %{http_code}\n" -H "$H" -d "$(jq -nc --arg e "$ADMIN_EMAIL" --arg p "$NOPE" '{json:{email:$e,password:$p}}')" "$R/api/trpc/auth.signInEmail"
# the generated login sets a session cookie
curl -s -c "$JAR" -o /dev/null -w "login: %{http_code}\n" -H "$H" -d "$(jq -nc --arg e "$ADMIN_EMAIL" --arg p "$ADMIN_PASSWORD" '{json:{email:$e,password:$p}}')" "$R/api/trpc/auth.signInEmail"
# a project and its write client: the response carries the client id and its secret, shown once
OUT=$(curl -s -b "$JAR" -H "$H" -d "{\"json\":{\"organization\":\"Agent $$\",\"project\":\"Site\",\"domain\":\"\",\"cors\":[],\"website\":false,\"app\":false,\"backend\":true}}" "$R/api/trpc/onboarding.project")
CID=$(echo "$OUT" | jq -r '.result.data.json.id'); SEC=$(echo "$OUT" | jq -r '.result.data.json.secret')
BODY='{"type":"track","payload":{"name":"hello","properties":{"from":"agent"}}}'
# write-auth: POST /api/track needs the client id and secret; without them, or with a wrong secret, the answer is 401
curl -s -o /dev/null -w "write with key: %{http_code}\n" -H "$H" -H "openpanel-client-id: $CID" -H "openpanel-client-secret: $SEC" -d "$BODY" "$R/api/track"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -H "$H" -d "$BODY" "$R/api/track"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -H "$H" -H "openpanel-client-id: $CID" -H "openpanel-client-secret: sec_wrong" -d "$BODY" "$R/api/track"
Expected output against a fresh deploy:
health: 200
public signup: 401
wrong login: 401
login: 200
write with key: 200
write without key: 401
write wrong key: 401
The refusals are the contract: a request without a key is refused (write without key: 401), a stranger cannot register (public signup: 401) and a wrong password is refused (wrong login: 401).
Why Deploy OpenPanel on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying OpenPanel on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
- Agent-ready - no deployer fields, a contract block, and one script that proves the app is healthy, strangers cannot register, the generated login works and the event API refuses writes without a key.
- Owner included - the first account is created before the site is reachable, so nobody can claim it.
- One domain - the API and the dashboard share a single public address, so SDKs and the browser use the same origin.
- Data survives redeploys - accounts in PostgreSQL on a volume, events in ClickHouse on a volume, Redis on a volume.
- Pinned - OpenPanel, PostgreSQL, Redis and ClickHouse are pinned by digest, and the wrapper by tag and digest.
Common Use Cases
- Privacy-friendly website analytics - page views, sessions, referrers and a live view without handing visitor data to a third party.
- Product analytics for an app - events, funnels and retention from the OpenPanel SDKs, instead of a Mixpanel subscription.
- Analytics for AI agents - give an agent a generated login and a write client to record and read the events it needs between tasks.
Dependencies for OpenPanel Hosting
- The openpanel, dashboard and worker services, a PostgreSQL service, a Redis service and a ClickHouse service, each stateful one with its volume, created by the template.
Deployment Dependencies
Template Content
dashboard
lindesvard/openpanel-dashboard:2.3.0cache
redis:8.2.1-alpineclickhouse
clickhouse/clickhouse-server:25.10.2.65database
postgres:17