---
title: "Deploy OpenPanel | (Just Updated) Open-Source Mixpanel Alternative, Admin Login Pre-Created, Sign-up Closed"
description: "OpenPanel web and product analytics, Mixpanel alternative, login included"
category: "Other"
url: https://railway.com/deploy/openpanel-or-just-updated-open-source-mi
---

# Deploy OpenPanel | (Just Updated) Open-Source Mixpanel Alternative, Admin Login Pre-Created, Sign-up Closed

OpenPanel web and product analytics, Mixpanel alternative, login included

**[Deploy OpenPanel | (Just Updated) Open-Source Mixpanel Alternative, Admin Login Pre-Created, Sign-up Closed on Railway](https://railway.com/template/openpanel-or-just-updated-open-source-mi)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/openpanel-or-just-updated-open-source-mi/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Other

## Template content

### dashboard

- **Image:** lindesvard/openpanel-dashboard:2.3.0@sha256:b773cf864454a0ec89b2a133b48bf06202880ed650a75cc2f1f5c87aaed1cffa

### cache

- **Image:** redis:8.2.1-alpine@sha256:987c376c727652f99625c7d205a1cba3cb2c53b92b0b62aade2bd48ee1593232
- **Start command:** `/bin/sh -c 'rm -rf /data/lost+found && chown -R redis:redis /data && exec docker-entrypoint.sh redis-server --requirepass "$REDIS_PASSWORD" --appendonly yes --maxmemory-policy noeviction --dir /data'`

### clickhouse

- **Image:** clickhouse/clickhouse-server:25.10.2.65@sha256:e019438e1e0539b0d1ce8380b628f1c06c5a0e641f368fc746acf4a8cf48d2f2
- **Start command:** `/bin/sh -c 'rm -rf /var/lib/clickhouse/lost+found && CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 exec /entrypoint.sh'`

### openpanel

- **Image:** ghcr.io/bon5co/openpanel-railway:2.3.0@sha256:debc998a994f73c4598ad7a8cfbf94cc644fe098c8b6eda87ba830fbc029adde
- **Health check:** /api/healthcheck
- **Public domain:** Yes

### worker

- **Image:** lindesvard/openpanel-worker:2.3.0@sha256:b22e247fb6980b820c1a954d0e3d2fe88b3edf40a58aa53329467af239538e80
- **Start command:** `/bin/sh -c 'sleep 60; NODE_ENV=production SELF_HOSTED=true exec node dist/index.js'`

### database

- **Image:** postgres:17@sha256:b60e90042aa6b8dbecd58e224b3e36114dbf8ad754465264c2476ad58a86e45c

## Documentation

# 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 the `openpanel` service)
- Private URL: `http://openpanel.railway.internal:3000` (the API; the dashboard answers on `http://dashboard.railway.internal:8080`)
- Credentials: the variables `ADMIN_EMAIL` and `ADMIN_PASSWORD` on the `openpanel` service (plain text); the event client id and secret are created after sign-in
- Auth: `POST /api/trpc/auth.signInEmail` with a JSON body of email and password wrapped in a `json` object sets a session cookie; `POST /api/trpc/onboarding.project` with that cookie creates a project and returns a write client id and secret, sent as the `openpanel-client-id` and `openpanel-client-secret` headers on `POST /api/track`, which answers 401 without them
- Health: `GET /api/healthcheck` returns 200 without credentials

```bash
#!/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:

```text
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

- [OpenPanel repository](https://github.com/Openpanel-dev/openpanel)
- [OpenPanel documentation](https://openpanel.dev/docs)
- [Wrapper image source](https://github.com/bon5co/openpanel-railway)


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — Self-hosted virtual tabletop for role-playing games (license required)
- [Double Commander in your browser](https://railway.com/deploy/double-commander-in-your-browser) — The Double Commander file manager in the cloud, from any device

Open this page in a browser: https://railway.com/deploy/openpanel-or-just-updated-open-source-mi
