---
title: "Deploy OpenPanel"
description: "Open-source Mixpanel alternative: funnels, retention & replay"
category: "Analytics"
url: https://railway.com/deploy/openpanel-2
---

# Deploy OpenPanel

Open-source Mixpanel alternative: funnels, retention & replay

**[Deploy OpenPanel on Railway](https://railway.com/template/openpanel-2)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/openpanel-2/manifest.json

- **Creator:** onepush
- **Category:** Analytics

## Template content

### op-postgres

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

### op-proxy

- **Image:** caddy:2-alpine@sha256:d8542f48d34a9cf4e4c11a478865229840e87e4c96ea3f439101f31a5d35f75f
- **Start command:** `sh -c "echo \"$CADDYFILE\" > /etc/caddy/Caddyfile; echo START_OK PORT=$PORT; cat /etc/caddy/Caddyfile; exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile"`
- **Public domain:** Yes

### op-api

- **Image:** lindesvard/openpanel-api:2.3.0@sha256:cee4855cd715a7248c5c49090fe93a28ffc505541de20cb238d8884a6bcb9223
- **Start command:** `sh -c "echo Running migrations...; CI=true pnpm -r run migrate:deploy; exec pnpm start"`
- **Health check:** /healthcheck

### op-redis

- **Image:** redis:8.2.1@sha256:5fa2edb1e408fa8235e6db8fab01d1afaaae96c9403ba67b70feceb8661e8621
- **Start command:** `/bin/sh -c "rm -rf ${RAILWAY_VOLUME_MOUNT_PATH}/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass ${REDIS_PASSWORD} --bind '* -::*' --protected-mode no --port ${PORT:-6379} --save 60 1 --dir ${RAILWAY_VOLUME_MOUNT_PATH}"`

### op-clickhouse

- **Image:** clickhouse/clickhouse-server:25.12@sha256:8a790dd3468db22b1d4e7b18a176f378ff5ff6053b9c48dd4ea1fa71a24c5ba6
- **Start command:** `sh -c 'mkdir -p /etc/clickhouse-server/config.d && printf "%s\n" "<clickhouse><listen_host>::</listen_host><listen_host>0.0.0.0</listen_host><trace_log remove=\"remove\"/><text_log remove=\"remove\"/><metric_log remove=\"remove\"/><asynchronous_metric_log remove=\"remove\"/><processors_profile_log remove=\"remove\"/><query_metric_log remove=\"remove\"/><query_thread_log remove=\"remove\"/><query_views_log remove=\"remove\"/><asynchronous_insert_log remove=\"remove\"/><opentelemetry_span_log remove=\"remove\"/><background_schedule_pool_log remove=\"remove\"/></clickhouse>" > /etc/clickhouse-server/config.d/railway-listen.xml && exec /entrypoint.sh'`

### op-worker

- **Image:** lindesvard/openpanel-worker:2.3.0@sha256:b22e247fb6980b820c1a954d0e3d2fe88b3edf40a58aa53329467af239538e80
- **Health check:** /healthcheck

### op-dashboard

- **Image:** lindesvard/openpanel-dashboard:2.3.0@sha256:b773cf864454a0ec89b2a133b48bf06202880ed650a75cc2f1f5c87aaed1cffa
- **Health check:** /api/healthcheck

## Documentation

# Deploy and Host self hosted OpenPanel (Open-Source Product Analytics) on Railway

OpenPanel 2.3.0 runs as a digest-pinned seven-service stack on Railway. It pins current lindesvard/openpanel-api, -dashboard, and -worker images, sets API_HOST=:: for IPv6, and needs no deploy-time config beyond one public domain. You get event analytics, sessions, funnels, and replays without a SaaS.

## About Hosting OpenPanel open-source software on Railway (self hosted OpenPanel template)

OpenPanel is AGPL-3.0 product analytics with a Next.js dashboard, Fastify API, Postgres for accounts, ClickHouse for events, and Redis for cache, pub/sub, and queues. The Railway template deploys seven digest-pinned services for 2.3.0, updating the older 2.2 listing. op-proxy runs caddy:2-alpine on port 8080 and is the only public service.

Private services: op-api (Fastify, port 3000, runs `pnpm -r run migrate:deploy` before start), op-dashboard (Next.js, port 3000, health /api/healthcheck), op-worker (queue jobs, port 3000), op-postgres (postgres-ssl:17, volume), op-redis (8.2.1, password, appendonly, volume /data), and op-clickhouse (25.12, HTTP 8123, listens on ::, volume /var/lib/clickhouse, noisy logs disabled).

## Why Deploy OpenPanel, the Mixpanel alternative on Railway (Railway Free Trial)

OpenPanel gives product analytics without per-event SaaS pricing. One public domain keeps cookies working without a custom domain; /api/healthcheck through the proxy returns ready with redis, db, and ch flags. Start with Railway's $5 trial, then expect about $20-40/mo at low volume because all seven services stay running.

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.

### Railway vs Other Hosting Providers and VPS for OpenPanel self hosting

| Provider | Setup | Cost | Maintenance | Best for |
| --- | --- | --- | --- | --- |
| DigitalOcean | Manual Docker Compose or one-click droplet | Predictable VPS pricing, but you pay for unused capacity | You manage OS updates, backups, and scaling | Teams comfortable with Linux and Docker |
| AWS | Manual ECS, EC2, or RDS/ClickHouse setup | Complex, can grow quickly with data egress and storage | High operational overhead, IAM, security groups | Enterprises with existing AWS governance |
| Hetzner | Manual VPS plus Docker Compose | Cheap compute and storage, especially in EU | You handle everything, including ClickHouse tuning | Cost-sensitive self-hosters in Europe |

## Common Use Cases for hosted OpenPanel

OpenPanel suits product teams needing user-level analytics without a third-party SaaS. Track activation funnels, build retention cohorts, inspect user profiles and session history, and watch session replays for debugging. Real-time dashboards support launch monitoring; A/B testing breakdowns compare variants without extra tooling.

## Dependencies for OpenPanel Docker hosted on Railway

The Railway template uses Docker images for the OpenPanel API, dashboard, and worker, plus Postgres, Redis, ClickHouse, and Caddy containers. All run on Railway's private network; only op-proxy exposes a public port. Persistent volumes are required for Postgres data, Redis appendonly data, and ClickHouse events.

### Deployment Dependencies for Managed OpenPanel Service (Product Analytics)

The managed deployment needs Postgres 17 with SSL, Redis 8.2.1 with password and appendonly persistence, and ClickHouse 25.12 listening on IPv6. The API needs DATABASE_URL and DATABASE_URL_DIRECT for migrations and direct queries. The worker needs REDIS_URL for queues and CLICKHOUSE_URL for event writes.

### Implementation Details for OpenPanel (Using OpenPanel official docker images)

The template uses digest-pinned lindesvard/openpanel-api, -dashboard, and -worker images for 2.3.0. API and worker set API_HOST=:: so they listen on IPv6 for Railway private networking, matching upstream docs. The API runs `pnpm -r run migrate:deploy` on start, then serves port 3000 with /healthcheck. The dashboard serves Next.js on port 3000 with /api/healthcheck.

## How does OpenPanel compare against other analytics platforms

### OpenPanel vs Mixpanel

- **Licensing:** OpenPanel AGPL-3.0 self-hostable; Mixpanel closed SaaS.
- **Data ownership:** OpenPanel stores events in your ClickHouse/Postgres; Mixpanel keeps them on its servers.
- **Pricing:** Self-host OpenPanel free unlimited; Mixpanel free tier then per-event.
- **Features:** Both offer funnels, retention, cohorts, profiles, replay, A/B; OpenPanel runs on your stack.

### OpenPanel vs PostHog

- **Open-source scope:** OpenPanel full AGPL-3.0; PostHog core MIT, some enterprise closed.
- **Feature breadth:** PostHog adds feature flags and experiments; OpenPanel focuses on analytics, replay, dashboards.
- **Self-host weight:** OpenPanel Railway template lighter; PostHog recommended self-host adds Kafka and object storage.
- **Hobby limits:** PostHog hobby deploy limited; OpenPanel self-host has no event or feature cap.

### OpenPanel vs Plausible

- **Analytics type:** Plausible is privacy-friendly web analytics with pageviews; OpenPanel is user-level product analytics with events, funnels, cohorts, replay.
- **Self-host stack:** Plausible simpler, single service plus Postgres and ClickHouse; OpenPanel adds Redis, worker, proxy.
- **Use case:** Plausible replaces Google Analytics for traffic; OpenPanel replaces Mixpanel or Amplitude for product behavior.

### OpenPanel vs Google Analytics 4

- **Data access:** GA4 sampled or delayed UI, raw data via BigQuery; OpenPanel direct SQL to ClickHouse events.
- **Pricing:** GA4 free up to limits but locks you into Google; OpenPanel self-hosting free unlimited.
- **Privacy:** GA4 faces GDPR challenges in parts of EU; self-hosted OpenPanel keeps data in your Railway region.

## How to use OpenPanel (the OSS product analytics platform)?

After deploy, open the public domain. Create the first account; registration closes automatically after it. Create a project, copy the web SDK snippet, and add it to your site. Point the SDK's apiUrl at https://your-app.up.railway.app/api. For mobile, install the React Native, Swift, or Kotlin SDK and use the same apiUrl. For server events, use a server SDK.

## How to self host OpenPanel on other VPS Services (OpenPanel self hosting guide)

Upstream provides Docker Compose files and a setup script at openpanel.dev/docs/self-hosting. The flow: clone the repository, install Docker and Node dependencies, configure environment variables, and start services. Size the VPS for ClickHouse and bring a domain or subdomain.

### Clone the Repository

Run `git clone https://github.com/Openpanel-dev/openpanel` and pin the 2.3.0 images rather than tracking latest. The repository includes Docker Compose definitions, migration scripts, and example environment files.

### Install Dependencies

Install Docker Engine and Docker Compose. Node.js and pnpm are needed only if you build images yourself. The upstream setup script can install packages and start the stack, but review what it changes first.

### Configure Environment Variables

Let the setup script generate the env file, or set SELF_HOSTED=true, COOKIE_SECRET, DATABASE_URL, DATABASE_URL_DIRECT, REDIS_URL, CLICKHOUSE_URL, DASHBOARD_URL, API_URL, and API_URL_SSR. Generate passwords for Postgres, Redis, and ClickHouse. Set ALLOW_REGISTRATION=true for the first user and ALLOW_INVITATION=true.

### Start the OpenPanel Application

Run `docker compose up -d` or the setup script. Wait for API migration, then check /api/healthcheck through the proxy or directly on the API port. Open the dashboard, create the first account, add your SDK snippet, and confirm events appear in a live dashboard.

## Official Pricing of OpenPanel (OpenPanel pricing)

OpenPanel cloud pricing is based on monthly events, everything else unlimited: 5K events $2.50/mo, 100K $20/mo, 1M $90/mo, 10M $350/mo. Yearly billing gives two months free, with a 30-day free trial. Self-hosting is free with unlimited events, but you pay infrastructure.

## OpenPanel cloud vs self hosted comparison (Pricing, features, costs, and more)

Cloud removes infrastructure work but charges per event. Self-hosting on Railway costs a flat monthly amount and allows unlimited events, but you manage backups, upgrades, and scaling.

### Monthly cost of self hosting OpenPanel on Railway

Expect about $20-40/mo at low volume, because ClickHouse, Postgres, Redis, and four app services run continuously. ClickHouse is the biggest line, and it grows with event volume and retention.

### System Requirements for Hosting OpenPanel on a VPS

ClickHouse wants the most memory, so give it room first. The four Node services are light, and Postgres and Redis stay small. Plan disk around event volume and retention.

## Frequently Asked Questions (FAQs)

### Is OpenPanel free to self host?

Yes. It is AGPL-3.0 with unlimited events; you pay only for hosting.

### Why is there a Caddy proxy?

It puts the dashboard and API on one public domain, so cookies and the SDK apiUrl work without a custom domain.

### What does API_HOST=:: do?

It makes the API and worker listen on IPv6, which Railway's private network uses. Without it, internal calls fail.

### How do I close sign-ups?

Registration closes automatically after the first account. Invite teammates after that.

### How do I send invite and reset emails?

Set RESEND_API_KEY and EMAIL_SENDER on the app services and redeploy.

### How do I update OpenPanel?

Change the pinned api, dashboard, and worker tags together to a newer release and redeploy. The API runs migrations on start.


## Similar templates

- [Formbricks | Open-Source Typeform & Qualtrics Alternative](https://railway.com/deploy/formbricks-surveys) — Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube
- [Typesense PHP](https://railway.com/deploy/typesense-php) — official PHP client against Railway
- [Typesense vs Meilisearch](https://railway.com/deploy/typesense-vs-meilisearch) — self-hosted Typesense vs Meilisearch

Open this page in a browser: https://railway.com/deploy/openpanel-2
