Deploy GrowthBook | Open Source LaunchDarkly Alternative on Railway
Self Host GrowthBook: Feature Flags, A/B Testing & Analytics
GrowthBook
Just deployed
/usr/local/src/app/packages/back-end/uploads
MongoDB
Just deployed
/data/db
Deploy and Host GrowthBook
GrowthBook is an open-source feature flagging, A/B testing, and product analytics platform — the self-hosted alternative to LaunchDarkly and Statsig used by teams who want full data control and warehouse-native experimentation without per-seat pricing surprises.
Deploy GrowthBook on Railway with this template and you get the full stack pre-wired.
The app bundles a NextJS front-end, an ExpressJS API, and a Python stats engine into a single Docker image. This template handles the multi-service orchestration so you can self-host GrowthBook on Railway in minutes, not hours.
⚠️IMP: Railway-Specific Setup: Two Domains for One Service
GrowthBook exposes two ports from a single container: port 3000 (the UI) and port 3100 (the API). Railway allows multiple public domains per service, but the UI only shows a single "Generate Domain" button — clicking it once disables the button before a second domain can be generated.
The workaround: click "Generate Domain" multiple times in rapid succession before the UI disables the button. This is a UI guard only — the Railway platform fully supports multiple domains per service (and it can also be done via the Railway API).

Once you have two domains:
- Set one domain's port to
3000→ copy the URL → paste asAPP_ORIGINin the env variable of GrowthBook - Set the other domain's port to
3100→ copy the URL → paste asAPI_HOST - Redeploy GrowthBook to pick up the updated variables

Both domains must share the same root domain for auth cookies to work. Railway's *.up.railway.app subdomains satisfy this automatically.
Getting Started with GrowthBook on Railway
Once the template is deployed and both domains are configured, open your APP_ORIGIN URL in a browser. GrowthBook will prompt you to create your first admin account — fill in your name, email, and password to complete registration.
From there, connect a data source (BigQuery, Snowflake, Postgres, Redshift, and others are supported), define your metrics using SQL, and create your first feature flag or experiment. The GrowthBook SDK (available for React, Node, Python, Go, iOS, Android, and 20+ others) connects to your API_HOST URL for flag evaluation.

About Hosting GrowthBook
GrowthBook is a warehouse-native experimentation platform. Unlike tools that store your event data on their servers, GrowthBook queries your existing data warehouse directly — your data stays where it already lives. It was built for teams that run serious experiments and want statistical rigour (CUPED, Sequential testing, Bayesian analysis, Bandits, SRM checks) without building an in-house platform.
Key features:
- Feature flags with advanced targeting, gradual rollouts, and percentage-based splits
- A/B testing with a world-class stats engine — CUPED, Sequential, Bayesian, Bandit support
- Warehouse-native: queries BigQuery, Snowflake, Redshift, Databricks, Postgres, and more
- 24+ SDKs — React, Node, Python, Go, iOS, Android, PHP, Ruby, and more
- Visual editor for no-code experiment setup
- OpenFeature-compatible for vendor-neutral flag evaluation
Why Deploy GrowthBook on Railway
One-click deploy with zero Docker or volume config to write yourself. Railway handles:
- Private networking between GrowthBook and MongoDB out of the box
- Auto-generated secrets for
JWT_SECRETandENCRYPTION_KEYon first deploy - Persistent volumes for both MongoDB data and GrowthBook uploads
- Managed TLS and custom domain support
- Vertical scaling if your experiment workload grows
Common Use Cases
- Replacing LaunchDarkly or Statsig — teams migrating off expensive per-seat or per-MAU SaaS pricing to a self-hosted stack with no flag evaluation fees
- Warehouse-native experimentation — data science teams who already have Snowflake or BigQuery and want to run A/B tests against their existing event tables without copying data to a third-party platform
- Progressive feature rollouts — engineering teams doing canary releases, percentage rollouts, and kill-switch flags across web, mobile, and backend services simultaneously
- B2B SaaS experimentation — teams using hash-based bucketing on
company_idto ensure all users within a tenant see the same flag state during a rollout
Dependencies for GrowthBook
- GrowthBook —
growthbook/growthbook:latest(Docker Hub · GitHub) - MongoDB —
mongo:latest(Docker Hub) — stores feature flags, experiment metadata, user credentials, and cached results
Environment Variables Reference
| Variable | Description | Required |
|---|---|---|
APP_ORIGIN | Public URL for port 3000 (UI). Set after generating Railway domain. |