
Deploy Rocket.Chat
Rocket.Chat 9 team chat with a self-initialising MongoDB 8 replica set
Rocket.Chat
Just deployed
MongoDB
Just deployed
/data/db
Deploy and Host Rocket.Chat on Railway
Rocket.Chat is an open-source team chat platform: channels, direct messages, threads, file sharing and audio/video calls, with desktop and mobile apps. You host it yourself, so your conversations and files stay in your own database. It is often used as a self-hosted alternative to Slack or Microsoft Teams.
About Hosting Rocket.Chat
This template runs two services. Rocket.Chat 9.0.0 (official image, pinned by digest) is served on a public Railway domain with a /health check. MongoDB 8.0 runs as a single-node replica set rs0, which Rocket.Chat 9 needs. The replica set is created automatically on first start, with authentication and a generated keyfile. Data and uploaded files (GridFS) live in MongoDB on a Railway volume, so they survive redeploys. An admin account is created on first boot with a generated password. When that admin first signs in, Rocket.Chat 9 keeps them in the setup wizard until the workspace is registered with a free Rocket.Chat Cloud account.
Common Use Cases
- Private team chat for a company, club or open-source project
- Customer or community support channels with file sharing
- Self-hosted alternative to Slack or Microsoft Teams with your own data retention
Dependencies for Rocket.Chat Hosting
- MongoDB 8.0 as a replica set (included, on a Railway volume)
- A Rocket.Chat Cloud account (free) to register the workspace on first admin login
Deployment Dependencies
- Rocket.Chat 9.0.0 release notes
- Rocket.Chat Docker deployment docs
- Official compose files
- MongoDB 8.0 image
Implementation Details
- First login: sign in as
adminwith theADMIN_PASSvalue shown in the Rocket.Chat service's Variables tab. The setup wizard then asks for your organisation details and a workspace registration (by email, or offline with a token). Registration is free, and mobile push notifications need it. - Database URL: Rocket.Chat connects with
${{MongoDB.MONGO_URL}}over the private network. The replica set member islocalhost:27017, so external tools must connect withdirectConnection=true. - Kernel workaround: the MongoDB start command sets
GLIBC_TUNABLES=glibc.pthread.rseq=1. MongoDB 8.0 otherwise refuses to start on Linux kernels 6.19 to 7.0.13 (SERVER-121912). - Email: set up SMTP under Administration > Settings > Email before you invite users. Users with a verified email are asked for an email 2FA code when they sign in.
Why Deploy Rocket.Chat 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 Rocket.Chat on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
Rocket.Chat
rocketchat/rocket.chat:9.0.0ADMIN_EMAIL
MongoDB
mongo:8.0.34