Railway

Deploy OpenPanel — Self-Hosted Product Analytics

Self-host OpenPanel — product & web analytics with mobile SDKs

Deploy OpenPanel — Self-Hosted Product Analytics

Just deployed

Just deployed

Just deployed

Just deployed

/var/lib/postgresql/data

Just deployed

/data

Just deployed

/var/lib/clickhouse

Deploy and Host OpenPanel on Railway

OpenPanel is an open-source analytics platform that combines the depth of Mixpanel with the privacy of Plausible — product analytics for web and mobile apps, self-hosted so your event data stays yours. Track funnels, retention, user profiles, and custom events with mobile SDKs (React Native, iOS, Android), a JavaScript tracker, and a full event API — all cookieless, so there's no consent banner. This template deploys the full stack — dashboard, event API, worker, PostgreSQL, ClickHouse, and Redis — wired behind a single domain, so login and tracking work on the first deploy.

What This Template Deploys

ServicePurpose
DashboardThe analytics UI (Next.js), served with the API on one domain
Event APIThe Fastify ingestion endpoint for events from your apps
WorkerProcesses queued events into ClickHouse
PostgreSQLMetadata — users, projects, dashboards, config
ClickHouse / RedisEvent store for high-volume data; Redis buffers and queues

A Caddy reverse proxy serves the dashboard and API from one domain so authentication and cookies work correctly. All data stores stay on Railway's private network.


About Hosting

OpenPanel is a serious analytics stack, and one configuration detail decides whether login works at all — this template handles it.

The dashboard and API must share one domain, or auth breaks. OpenPanel serves the dashboard and event API through a single Caddy reverse proxy, and DASHBOARD_URL and API_URL must both point at that one domain. Authentication cookies are tied to the domain — if the dashboard and API are on different hosts, login silently fails and events won't associate correctly. This template wires the single-domain Caddy setup, so auth works immediately.

ClickHouse stores the events; Postgres holds the metadata. OpenPanel splits storage: ClickHouse handles high-volume event data, PostgreSQL holds transactional metadata (users, projects, dashboards), and Redis buffers incoming events before they're flushed to ClickHouse in batches. Wiring these together correctly is the work this template does for you.

Cookieless by design — no consent banner. OpenPanel tracks without cookies, so it's privacy-compliant out of the box and needs no consent banner, counting every visitor accurately without the friction of Google Analytics.

Set COOKIE_SECRET, lock registration, add email. COOKIE_SECRET is a random 32-character value that signs sessions — set it and keep it stable. Set ALLOW_REGISTRATION=false after creating your account, ALLOW_INVITATION=true to invite your team, and RESEND_API_KEY (or SMTP_*) to enable invitations and password resets — without it, those emails only log to the console.

Mobile and web SDKs, one backend. OpenPanel's real edge is tracking both web and native mobile apps into one platform — React Native, iOS, Android, a JS tracker, and zero-JS data-track HTML attributes all feed the same event API. Point your apps at your Railway domain and start sending events.

Typical cost: ~$15–25/month on Railway across the services, more under heavy event volume. OpenPanel is open source (AGPL-3.0) and free — versus Mixpanel's per-event pricing.


How It Compares

OpenPanel (self-hosted)Google AnalyticsMixpanelPlausible
TypeProduct + web analyticsWeb analyticsProduct analyticsWeb analytics
Mobile SDKsYes (RN, iOS, Android)LimitedYesNo
Funnels & retentionYesLimitedYesNo
CookielessYesNoNoYes
Data ownershipFull — your infraGoogleVendorVendor/self
Self-hostableYesNoNoYes

Google Analytics is free but takes your data and needs a consent banner. Mixpanel has deep product analytics but is cloud-only and priced per event. Plausible is privacy-first but web-only, without product analytics or mobile. OpenPanel's edge is combining both — Mixpanel-style funnels, retention, and profiles across web and mobile, cookieless — self-hosted, with your event data on infrastructure you own.


Deploy in Under 5 Minutes

  1. Click Deploy on Railway — all services build and wire behind the Caddy proxy (~5 minutes)
  2. Confirm DASHBOARD_URL and API_URL point at your single Railway domain
  3. Confirm COOKIE_SECRET is set and ALLOW_REGISTRATION=false
  4. Open your Railway domain, create your account, and set up a project
  5. Add the SDK for your platform (web, React Native, iOS, Android) and start sending events

Set RESEND_API_KEY or SMTP_* to enable team invitations and password-reset emails.


Common Use Cases

  • Product analytics — funnels, retention, and user journeys to understand how people use your app
  • Mobile app analytics — track native iOS, Android, and React Native apps into one platform
  • Privacy-first web analytics — cookieless tracking with no consent banner, as a Google Analytics alternative
  • Custom event tracking — arbitrary events with any properties, no fixed schema or reserved names

Configuration

VariableRequiredDescription
DASHBOARD_URLRequiredYour single Railway domain — must match the Caddy-served host
API_URLRequiredThe same domain with /api — auth cookies depend on this matching
COOKIE_SECRETRequiredRandom 32-char secret that signs sessions — keep stable
DATABASE_URLAuto-injectedPostgreSQL connection via Railway reference variable
REDIS_URLAuto-injectedRedis connection for buffering and queues
ALLOW_REGISTRATIONRecommendedfalse after creating your account
RESEND_API_KEY / SMTP_*OptionalEmail for invitations and password resets

Dashboard and API must share one domain. DASHBOARD_URL and API_URL must point at the same Caddy-served Railway domain, or auth cookies break and login fails silently. This template wires the single-domain setup.

Set COOKIE_SECRET and lock registration. Use a stable 32-char secret for sessions, set ALLOW_REGISTRATION=false after signup, and add RESEND_API_KEY or SMTP so invites and resets send.


Dependencies for OpenPanel Hosting

  • Railway account — ~$15–25/month across the services, more under heavy volume
  • PostgreSQL, ClickHouse, and Redis (all included and wired)
  • The OpenPanel SDK for each platform you track (web, React Native, iOS, Android)
  • Optional: a Resend API key or SMTP for invitation and reset emails

Deployment Dependencies

Implementation Details

The template runs OpenPanel's full stack: the Next.js dashboard, the Fastify event API, a queue worker, PostgreSQL for metadata, ClickHouse for the event store, and Redis for buffering. A Caddy reverse proxy serves the dashboard and API from a single domain, which is required because authentication cookies are domain-bound — DASHBOARD_URL and API_URL must both resolve to that host or login fails. All data stores stay on the private network, with only the Caddy-fronted app public.

Events flow through Redis buffers before being flushed to ClickHouse in batches, keeping ingestion fast under load, with the worker handling processing asynchronously. COOKIE_SECRET signs sessions and must stay stable, ALLOW_REGISTRATION controls public signup, and email (via RESEND_API_KEY or SMTP) drives invitations and resets. Tracking is cookieless, so no consent banner is required, and the same event API ingests from web, React Native, iOS, and Android SDKs plus zero-JS data-track attributes. Metadata persists in PostgreSQL and events in ClickHouse, both of which should be backed up.


Frequently Asked Questions

Why must the dashboard and API share a domain? Authentication cookies are bound to the domain, so if the dashboard and event API are on different hosts, login fails silently. This template uses a Caddy proxy to serve both from one domain.

Can it track mobile apps? Yes — a core strength. OpenPanel has React Native, iOS, and Android SDKs alongside its web tracker, all feeding one backend, so you see web and native usage together.

Do I need a cookie consent banner? No. OpenPanel tracks cookielessly and is privacy-compliant by design, so you avoid the consent banner and tracking-blocker issues of Google Analytics.

How is it different from Plausible or Mixpanel? Plausible is privacy-first but web-only with no product analytics; Mixpanel has deep product analytics but is cloud-only and priced per event. OpenPanel combines both — funnels and profiles across web and mobile, cookieless and self-hosted.

Does my data persist? Yes — metadata in PostgreSQL and events in ClickHouse, both surviving redeploys. Back them up, since together they hold your analytics history.

How do I send events? Add the OpenPanel SDK for your platform (web, React Native, iOS, or Android) or use data-track HTML attributes, pointed at your Railway domain.


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 get a full product-analytics platform with the hard part solved — the dashboard and API served from one domain so auth works, ClickHouse and Postgres wired, and automatic HTTPS. Mixpanel-style analytics across web and mobile, cookieless and self-hosted, on infrastructure you own.


Template Content

More templates in this category

View Template
Matomo Analytics + MariaDB
Privacy-friendly analytics with MariaDB and persistent volumes.

leodev
1
View Template
Bugsink
Self-hosted Error Tracking. Sentry-SDK compatible

zǝʇɹoɔ oɓıɹpoɹ
19
View Template
SubTrackr
Self-hosted Subscription Tracker

amnesia
3