Deploy Rocket.Chat
Open-source Slack alternative: Rocket.Chat with a MongoDB replica set.
Directus
Rocket.Chat
Just deployed
MongoDB
Just deployed
/data/db
Deploy and Host Rocket.Chat on Railway
Rocket.Chat is an open-source team chat and customer-engagement platform — a self-hosted alternative to Slack and Microsoft Teams, with channels, direct messages, voice/video, and a livechat widget for your website. This template runs Rocket.Chat with a correctly configured MongoDB.
About Hosting Rocket.Chat
Rocket.Chat is a Meteor application backed by MongoDB. The part almost every self-hosted setup gets wrong is the database: Rocket.Chat's realtime features (new messages appearing instantly, presence, livechat) depend on MongoDB running as a replica set so it can use change streams. A plain, standalone MongoDB boots fine but leaves realtime broken, which is why so many Rocket.Chat templates work at first and then feel dead. This template ships MongoDB pre-initialized as a single-node replica set, on the private network, with its data on a persistent volume, and connects Rocket.Chat to it with an admin account created for you.
Why Deploy Rocket.Chat on Railway?
Railway provisions Rocket.Chat and MongoDB, the private networking between them, and the database volume from this one template in one click. Compared with other Rocket.Chat templates, this one fixes what makes them unreliable:
- Realtime actually works. MongoDB is initialized as a replica set (rs0) automatically on first boot, so messages, presence, and livechat update live — not after a refresh.
- Nothing is lost. MongoDB (including uploaded files via GridFS) is stored on a persistent volume.
- Log in immediately. An admin is created on first boot from ADMIN_USERNAME / ADMIN_PASS, and the setup wizard is skipped.
- Pinned versions of both Rocket.Chat and MongoDB for reproducible deploys.
Common Use Cases
- Internal team chat as a self-hosted Slack or Teams replacement
- A customer support / livechat channel embedded on your website
- A private, data-resident community or client workspace
Dependencies for Rocket.Chat Hosting
- A MongoDB replica set (included and auto-configured in this template)
- A persistent volume for the database (included)
Deployment Dependencies
Implementation Details
On first login, use ADMIN_USERNAME (default admin) and copy ADMIN_PASS from the Rocket.Chat service's Variables tab; change them afterwards. MongoDB runs as replica set rs0 and is reachable only on the project's private network; Rocket.Chat connects to it via MONGO_URL. The database and all uploaded files persist on the MongoDB volume at /data/db.
Template Content
Rocket.Chat
rocketchat/rocket.chat:8.9.1MongoDB
mongo:7.0