Deploy GrowthBook [Updated Sep'26]
GrowthBook — Feature Flags & A/B Testing, no per-seat fees
GrowthBook
Just deployed
/usr/local/src/app/packages/back-end/uploads
MongoDB
Just deployed
/data/db
Deploy and Host GrowthBook on Railway
GrowthBook is an open-source feature flagging and A/B testing platform — a self-hosted alternative to LaunchDarkly, Statsig, and Optimizely with unlimited flags, experiments, and seats. Roll out features gradually, run kill-switches, and analyze experiments warehouse-native against your own Snowflake or BigQuery data, no per-seat or per-MAU fees. This template deploys the full stack with MongoDB, generated secrets, and — crucially — the frontend and API behind one hostname so the session cookie works, avoiding the "No authorization token" error that breaks most self-hosted deployments.
What This Template Deploys
| Service | Purpose |
|---|---|
| GrowthBook | The app frontend (port 3000) and API (port 3100) — flags, experiments, UI |
| MongoDB | Flags, experiments, metrics, users, and configuration |
Both connect over Railway's private network. GrowthBook runs its frontend and API together behind a single hostname, backed by MongoDB, with persistent volumes for the database and file uploads — a complete experimentation platform from the first deploy.
About Hosting
GrowthBook has a specific architecture that trips up most self-hosted deployments — getting it right is the whole game, and this template handles it.
Frontend and API must share a domain — or login breaks. This is the critical one: GrowthBook is two apps, a frontend (port 3000) and a separate API (port 3100), and browsers only keep the session cookie if both are served from the same registrable domain. Split them and you hit GrowthBook's infamous "No authorization token was found" error, unable to log in — the most common self-hosted failure. This template serves both behind one hostname with APP_ORIGIN and API_HOST set correctly, so authentication works on the first try.
Never change ENCRYPTION_KEY after setup. GrowthBook uses it to encrypt your data-source credentials (the keys to your Snowflake, BigQuery, or Postgres). Change it after data sources exist and those credentials become unreadable, requiring a migration script to recover. This template generates it once and keeps it stable, along with JWT_SECRET (which must be a strong random value — the default throws an error in production). Back the key up externally.
MongoDB is the database — not Postgres. Unlike most tools, GrowthBook stores everything (flags, experiments, metrics, users) in MongoDB, so this template includes and wires it over the private network with a persistent volume. File uploads live on a second volume; both survive redeploys, and MongoDB is the primary backup target. Warehouse-native experimentation — your data stays put. GrowthBook's standout is that it queries your existing data warehouse (Snowflake, BigQuery, Redshift, ClickHouse, Postgres) directly for experiment analysis, rather than copying event data into a third-party platform. Connect your warehouse as a data source and run A/B tests against tables you already have. After deploy, open your Railway domain to create the first organization and admin, then add SDK connections and start shipping flags.
Unlimited everything in the core. GrowthBook's core is MIT-licensed and free to self-host with unlimited flags, experiments, seats, and traffic — only enterprise features (SSO, SCIM, approval workflows, the visual editor) need a commercial key. A ten-person team on GrowthBook Cloud's $40/seat Pro tier saves roughly $4,800 a year by self-hosting.
Typical cost: ~$10–15/month on Railway for GrowthBook and MongoDB. The self-hosted core is free — no flag-evaluation, per-seat, or per-MAU fees, unlike LaunchDarkly or Statsig.
How It Compares
| GrowthBook (self-hosted) | LaunchDarkly | Statsig | Optimizely | |
|---|---|---|---|---|
| Cost model | Flat infra | Per seat + MAU | Per event/MAU | Enterprise |
| Flags + experiments | Both | Both | Both | Both |
| Warehouse-native | Yes | Limited | Partial | No |
| Seat / flag limits | Unlimited | Tiered | Tiered | Tiered |
| Data ownership | Full — your infra | Vendor | Vendor | Vendor |
| Self-hostable | Yes | No | No | No |
LaunchDarkly and Statsig are powerful but bill per seat, per MAU, or per event, which scales painfully, and they hold your experiment data. Optimizely is enterprise-priced. GrowthBook's edge is unlimited feature flags and experiments at flat infrastructure cost, with warehouse-native analysis that keeps your event data in your own Snowflake or BigQuery — self-hosted, on infrastructure you own.
Deploy in Under 5 Minutes
- Click Deploy on Railway — GrowthBook and MongoDB build and wire together (~4 minutes)
- Confirm
JWT_SECRETandENCRYPTION_KEYare generated andAPP_ORIGIN/API_HOSTmatch your domain - Open your Railway domain and create your first organization and admin account
- Add an SDK connection for your app (JavaScript, React, Python, Go, and more)
- Create a feature flag or experiment, and evaluate it in your app via the SDK
Connect your data warehouse as a data source to run warehouse-native experiment analysis.
Common Use Cases
- Feature flags and rollouts — canary releases, percentage rollouts, and kill-switches across web, mobile, and backend
- A/B testing — run experiments and analyze results against your own warehouse data
- B2B rollouts — hash-based bucketing on company_id so a whole tenant sees consistent flag state
Configuration
| Variable | Required | Description |
|---|---|---|
APP_ORIGIN | Required | Frontend URL — must share a domain with the API for cookies |
API_HOST | Required | API URL — same registrable domain as the frontend |
JWT_SECRET | Generated | Auth signing key — strong random value; the default errors in prod |
ENCRYPTION_KEY | Generated | Encrypts data-source credentials — never change after setup |
| Storage volumes | Pre-set | Persistent volumes for MongoDB data and uploads |
Same domain, or login breaks. GrowthBook's frontend and API must share a registrable domain or the browser drops the session cookie ("No authorization token"). This template serves both behind one hostname with
APP_ORIGIN/API_HOSTset — the fix for the top self-hosted failure.
Never change
ENCRYPTION_KEY. It encrypts your data-source credentials — rotating it after setup makes them unreadable. This template generates it once; back it up and keep it stable, along withJWT_SECRET.
Dependencies for GrowthBook Hosting
- Railway account — ~$10–15/month for GrowthBook and MongoDB
- MongoDB (included and wired via the private network)
- Persistent volumes for MongoDB data and file uploads (included)
- Optional: a data warehouse (Snowflake, BigQuery, etc.) as a data source for experiments
Deployment Dependencies
- GrowthBook GitHub Repository
- GrowthBook Documentation
- GrowthBook Self-Host Guide
- Railway Private Networking
Implementation Details
The template runs the official growthbook/growthbook image, which serves both the frontend (port 3000) and the API (port 3100), wired to a MongoDB database over Railway's private network with persistent volumes for MongoDB data and file uploads. GrowthBook stores all data — flags, experiments, metrics, users, and configuration — in MongoDB rather than a relational database.
The defining requirement is the shared domain: because the frontend and API are separate services, browsers only retain the session cookie when APP_ORIGIN and API_HOST resolve to the same registrable domain; splitting them causes the common "No authorization token was found" error. This template serves both behind one hostname. JWT_SECRET (which cannot be left at its default in NODE_ENV=production, or GrowthBook errors) and ENCRYPTION_KEY are generated; the encryption key must remain stable, as it encrypts stored data-source credentials and changing it requires running a migration script.
GrowthBook's core is MIT-licensed with unlimited flags, experiments, seats, and traffic; only enterprise features need a commercial key. Its warehouse-native model analyzes experiments by querying connected warehouses (Snowflake, BigQuery, Redshift, ClickHouse, Postgres) directly, keeping event data in place. First-run setup creates the initial organization and admin in the browser. MongoDB and the uploads volume are the backup targets.
Frequently Asked Questions
Why do I get "No authorization token was found"? GrowthBook's frontend and API must share a registrable domain, or the browser drops the session cookie. This template serves both behind one hostname with APP_ORIGIN and API_HOST set correctly, which fixes the most common self-hosted login failure.
Is it really unlimited? Yes — the MIT core is free to self-host with unlimited flags, experiments, seats, and traffic. Only enterprise features (SSO, SCIM, approval workflows, visual editor) need a commercial key, so most teams pay only for infrastructure.
Why Deploy GrowthBook 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 GrowthBook on Railway you get a feature-flagging and A/B-testing platform with the hard parts solved — MongoDB wired, secrets generated, and the frontend and API behind one hostname so login actually works. Unlimited flags and experiments with warehouse-native analysis, self-hosted on infrastructure you own.
Template Content
GrowthBook
growthbook/growthbookMongoDB
mongo:8.0