Deploy OpenPanel React Native

Mobile app analytics with the OpenPanel React Native SDK

Deploy OpenPanel React Native

Just deployed

Just deployed

Just deployed

/var/lib/clickhouse

Just deployed

Just deployed

/var/lib/postgresql/data

op-redis

redis:8.2.1

Just deployed

/data

Deploy and Host self hosted OpenPanel React Native (Open-Source Mobile Analytics for React Native and Expo) on Railway

This template runs a self-hosted OpenPanel stack and shows you how to wire the React Native SDK into an Expo app.

About Hosting OpenPanel React Native open-source software on Railway (self hosted OpenPanel for React Native apps template)

This template runs the full OpenPanel stack on your own Railway project: a Fastify event API, a Next.js dashboard, a worker, Postgres for account data, ClickHouse for the event firehose, and Redis for cache and queues.

Why Deploy OpenPanel React Native, the Firebase Analytics alternative on Railway (Railway Free Trial)

Firebase Analytics is free, but it is a closed Google product tied to GA4 and the Google SDKs, and you have little say over where raw event data lives.

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 React Native 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 React Native self hosting

Railway runs the seven-service OpenPanel stack from one template, while the others leave the wiring to you.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanTemplate deploy of all seven services, with a public domain and generated secrets.A Droplet or managed services you connect yourself with Docker Compose.
AWSServices deploy from the template with a public domain and no load balancer setup.Full control over VPC, ECS or EC2 and managed databases, plus more setup before the first event.
HetznerTemplate variables pre-filled, so apiUrl becomes your domain plus /api right away.Cheap, fast hardware, but you manage Docker, TLS and upgrades yourself.

Pick the option that matches how much infrastructure time you want to spend.

Common Use Cases for hosted OpenPanel React Native

  • Screen view tracking with expo-router: Call op.screenView from the root layout using usePathname and useSegments, so every route change lands in your dashboard without touching each screen.
  • Onboarding funnels: Track signup, permission prompts, and first key action as named events, then build a funnel to see where new users drop off in the first session.
  • Retention cohorts for a mobile app: Identify logged-in users with op.identify, then group them by first open week to see whether people come back after day one or day seven.
  • Feature usage events with properties: Send events like op.track('export_clicked', { format: 'csv' }) so you can see which features people use and how they break down by property.
  • One dashboard for web and app: Run the web SDK and the React Native SDK against the same project, so mobile and browser activity show up side by side on one self-hosted server.

Dependencies for OpenPanel React Native Docker hosted on Railway

Seven services run on Railway, but your React Native app only talks to one. op-proxy, a Caddy container on port 8080, is the only public service.

Deployment Dependencies for Managed OpenPanel React Native Service (Product Analytics)

Each service has a fixed image, and the volumes hold your event history. op-proxy uses caddy:2-alpine. op-api and op-dashboard both run on port 3000 with health checks at /healthcheck and /api/healthcheck.

Implementation Details for OpenPanel React Native (Using OpenPanel official docker image)

Most environment variables are filled in for you.

How does OpenPanel React Native compare against other mobile analytics options for React Native

OpenPanel vs Firebase Analytics (Google Analytics Alternative for React Native)

  • Ownership: OpenPanel runs on your server, so mobile events stay in your Postgres and ClickHouse. Firebase is free but closed, and the data sits in Google's infrastructure.
  • Lock-in: OpenPanel uses its own SDK and dashboard, and you can move it to any VPS. Firebase ties you to Google's SDKs and, for deeper analysis, GA4 and BigQuery.
  • Where Firebase wins: It's free at almost any scale and bundles crash reporting and push. If you already run Firebase, setup costs less.

OpenPanel vs Mixpanel (Self-Hosted Alternative to Mixpanel for React Native)

  • Hosting: Mixpanel is closed SaaS and can't run on your infrastructure. OpenPanel is AGPL-3.0, so you control the server and the retention data.
  • Feature depth: OpenPanel covers funnels, cohorts, retention, and real-time dashboards, which is most of what a mobile team needs.
  • Where Mixpanel wins: Its mobile reporting is mature and you don't run a database. If you'd rather pay per event and skip operating anything, it's easier.

OpenPanel vs PostHog (Open-Source Product Analytics Alternative for React Native)

  • Scope: PostHog bundles feature flags, session replay, and experiments. OpenPanel stays focused on product analytics.
  • Self-hosting weight: PostHog's self-hosted stack is heavier. OpenPanel's template is seven services and fits a modest Railway project.
  • Where PostHog wins: If you want flags and replay alongside analytics, PostHog covers more ground. Its MIT-licensed core is also more permissive than AGPL.

OpenPanel vs Amplitude (Self-Hosted Amplitude Alternative for React Native)

  • Hosting model: Amplitude is closed SaaS, so your event data lives on their servers. OpenPanel gives similar funnel and retention analysis on infrastructure you own.
  • Cost shape: Amplitude's costs rise with tracked users. Self-hosted OpenPanel's main cost is the Railway bill, which grows with event volume.
  • Where Amplitude wins: Its behavioral analytics and governance features are deep and mature, which can justify the spend for a large team with complex cohort work.

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

Work through these steps on your first day after the deploy finishes.

  1. Open your domain and create the first account. Registration closes after that. 2. Create a project and a client. Copy the client id and secret, since the secret is shown once. 3.
import { OpenPanel } from '@openpanel/react-native';
import { usePathname, useSegments } from 'expo-router';
import { useEffect } from 'react';

export const op = new OpenPanel({
  clientId: 'your-client-id',
  clientSecret: 'your-client-secret',
  apiUrl: 'https://your-domain/api',
});

export default function RootLayout() {
  const pathname = usePathname();
  const segments = useSegments();
  useEffect(() => {
    op.screenView(pathname, { segments });
  }, [pathname]);
  return null;
}

The client secret ships inside your app binary, since mobile SDKs have no CORS check.

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

Run OpenPanel as a Docker Compose stack on any VPS, then point the React Native SDK at your domain.

Clone the Repository

Pull the upstream repo and move into it.

git clone https://github.com/Openpanel-dev/openpanel.git
cd openpanel

Install Dependencies

Docker is all you need on the host, since the stack builds inside containers.

sudo apt update && sudo apt install -y docker.io docker-compose-plugin
sudo systemctl enable --now docker

Configure Environment Variables

Copy the example env file and set your public domain plus strong secrets.

cp .env.example .env
# set DASHBOARD_URL=https://your-domain
# set API_URL=https://your-domain/api
# set COOKIE_SECRET, POSTGRES_PASSWORD, REDIS_PASSWORD, CLICKHOUSE_PASSWORD

Start the OpenPanel React Native Application

Start the stack and put a TLS proxy like Caddy in front so /api reaches the API and everything else reaches the dashboard.

docker compose up -d
docker compose ps

On Railway, the template wires the proxy, databases and services for you.

Official Pricing of OpenPanel React Native (OpenPanel pricing)

OpenPanel React Native is free and open source under AGPL-3.0, so self-hosting has no license fees and unlimited events.

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

Self-hosting OpenPanel means you pay for Railway resources instead of event volume, and every React Native event stays on your server.

Monthly cost of self hosting OpenPanel React Native on Railway

Expect roughly $20-40 per month at low event volume, since ClickHouse, Postgres, Redis and the four app services all stay running.

System Requirements for Hosting OpenPanel React Native on a VPS

Plan for at least 4 GB of RAM and 2 vCPUs for a small app, because ClickHouse is the heavy service.

Frequently Asked Questions (FAQs)

Why does the React Native SDK need a client secret?

Mobile and server SDKs authenticate with clientId plus clientSecret because there is no CORS origin check to rely on.

Does the SDK work without Expo?

Yes, it works in bare React Native projects as long as expo-application and expo-constants are installed.

Is tracking cookieless on mobile?

Yes, the SDK sets no browser cookies because a native app has no cookie jar.

How do I track screens with React Navigation?

Call op.screenView(path, props) from the navigation state change, usually in the onStateChange handler on your NavigationContainer.

What happens to events when the device is offline?

Events send when the network is reachable, so test on a flaky connection and watch the real-time view.

How do I identify a logged-in user?

Call op.identify with a profileId that matches your own user id, plus optional email and properties.


Template Content

More templates in this category

View Template
NEW
Plausible WordPress
Cookie-free WordPress stats from your own Plausible

onepush
0
View Template
Typesense Multilingual
Locale-aware multilingual search with Typesense

onepush
0
View Template
Formbricks
Surveys, NPS and in-app feedback on your own Postgres, Hub and Cube

Two Workspaces
2