---
title: "Deploy countly-template-source"
description: "Deploy Countly Community with MongoDB on Railway"
category: "Analytics"
url: https://railway.com/deploy/countly-template-source
---

# Deploy countly-template-source

Deploy Countly Community with MongoDB on Railway

**[Deploy countly-template-source on Railway](https://railway.com/template/countly-template-source)**

- **Creator:** liyu's Projects
- **Category:** Analytics

## Template content

### MongoDB https://devicons.railway.app/i/mongodb.svg

- **Image:** mongo:8.0
- **Start command:** `docker-entrypoint.sh mongod --ipv6 --bind_ip ::,0.0.0.0 --setParameter diagnosticDataCollectionEnabled=false`

### countly-gateway

- **Source:** https://github.com/yunyu950908/countly-railway-template
- **Health check:** /health
- **Public domain:** Yes

### countly-frontend

- **Image:** countly/frontend:25.03.45

### countly-api

- **Image:** countly/api:25.03.45

## Documentation

# 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:

- `MongoDB` for Countly data and GridFS file storage.
- `countly-api` from `countly/api:25.03.45`.
- `countly-frontend` from `countly/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.0`
  - `countly/api:25.03.45`
  - `countly/frontend:25.03.45`
- GitHub source for the gateway service:
  - Repository: `yunyu950908/countly-railway-template`
  - Root directory: `/gateway`
  - Config file: `/gateway/railway.toml`

After deployment, open the public `countly-gateway` domain to complete Countly setup.


## Similar templates

- [Betterlytics](https://railway.com/deploy/betterlytics) — Betterlytics is a cookieless analytics platform GDPR-compliant.
- [Finance Tracker](https://railway.com/deploy/finance-tracker-1) — Private multi-user household finance ledger with budgets and CSV import.
- [Matomo Analytics + MariaDB](https://railway.com/deploy/matomo-analytics-mariadb) — Privacy-friendly analytics with MariaDB and persistent volumes.

Open this page in a browser: https://railway.com/deploy/countly-template-source
