Deploy countly-template-source
Deploy Countly Community with MongoDB on Railway
MongoDB
Just deployed
/data/db
countly-gateway
Just deployed
countly-frontend
Just deployed
countly-api
Just deployed
Deploy and Host Countly on Railway
Deploy Countly Community 25.03 with a production-style split service layout on Railway.
About Hosting
This template provisions Countly as four Railway services:
MongoDBfor Countly data and GridFS file storage.countly-apifromcountly/api:25.03.45.countly-frontendfromcountly/frontend:25.03.45.countly-gateway, an Nginx reverse proxy that exposes one public HTTP endpoint.
The gateway routes /i, /i/*, /o, and /o/* to the Countly API service, and all other paths to the Countly Frontend service.
Why Deploy
Countly is an open source product analytics platform for collecting events, sessions, crashes, user profiles, cohorts, dashboards, and SDK data. Railway is a good fit for this template because it can provision the required service graph, private networking, persistent MongoDB storage, and a public gateway endpoint from a reusable blueprint.
This template avoids the evaluation-oriented all-in-one shape and follows Countly's split API, Frontend, MongoDB, and reverse proxy deployment model.
Common Use Cases
- Host a self-managed Countly Community analytics instance.
- Collect product analytics from web, mobile, desktop, and server-side SDKs.
- Run a private analytics stack for internal products or prototypes.
- Evaluate Countly 25.03 with persistent MongoDB storage on Railway.
Dependencies for
This template is for Countly Community 25.03 deployments that use MongoDB and the official Countly Docker images.
Deployment Dependencies
- Railway workspace with enough resources for four services.
- MongoDB service with persistent storage mounted at
/data/db. - Docker images:
mongo:8.0countly/api:25.03.45countly/frontend:25.03.45
- GitHub source for the gateway service:
- Repository:
yunyu950908/countly-railway-template - Root directory:
/gateway - Config file:
/gateway/railway.toml
- Repository:
After deployment, open the public countly-gateway domain to complete Countly setup.
Template Content
MongoDB
mongo:8.0MONGOPORT
MONGO_INITDB_ROOT_USERNAME
countly-gateway
yunyu950908/countly-railway-templatecountly-frontend
countly/frontend:25.03.45NODE_OPTIONS
COUNTLY_PLUGINS
COUNTLY_CONFIG__FILESTORAGE
countly-api
countly/api:25.03.45NODE_OPTIONS
COUNTLY_PLUGINS
COUNTLY_CONFIG__FILESTORAGE
COUNTLY_CONFIG_API_API_WORKERS
