Why self-host Rocket.Chat on a VPS
Rocket.Chat goes further than a simple team messaging tool: it offers an omnichannel module (integration of WhatsApp, email, website chat widgets), audio and video calls, and federation via the Matrix protocol allowing communication with other servers. For an agency that wants to centralize both internal communication and customer support, self-hosting on a VPS avoids multiplying subscriptions and keeps all exchanges — including customer conversations — on an infrastructure you control. Rocket.Chat relies on MongoDB, which makes it a bit more resource-hungry than Mattermost, but opens the way to rich integrations and an extension marketplace.
Concrete benefits of a self-hosted Rocket.Chat
- Built-in omnichannel module to handle web support, email and messaging from a single interface.
- Audio/video calls and screen sharing without depending on a third-party service.
- Matrix federation to interconnect your server with other organizations.
- App marketplace and a broad catalog of integrations (webhooks, bots).
- Extensive customization of the instance's theme and branding.
- Conversation data and files kept on your own VPS.
Hardware and software prerequisites
Rocket.Chat and MongoDB are relatively memory-demanding. For a team of up to 50 users, plan for a VPS with 2 to 4 vCPU and at least 4 GB of RAM; aim for 8 GB for an active instance with omnichannel and video calls. MongoDB must absolutely run in replica set mode (even with a single node) because Rocket.Chat uses the oplog for real time. Count on 30 to 50 GB of SSD. You need Docker and Compose, a chat.yourdomain.com subdomain with an A record, and a reverse proxy that handles WebSockets.
Deploy Rocket.Chat with Docker and SSL
Provision the VPS
Install Docker and the Compose plugin, create /opt/rocketchat. Check that available RAM is sufficient: MongoDB and Rocket.Chat can saturate a 2 GB VPS under load.
Configure MongoDB in a replica set
Declare a mongodb service (image bitnami/mongodb or mongo) enabling the replica set: it is mandatory for the oplog. Without this step, Rocket.Chat starts but real time and some functions fail. Persist the data in a dedicated volume.
Define the Rocket.Chat service
Add the rocketchat service (image registry.rocket.chat/rocketchat/rocket.chat) with the MONGO_URL, MONGO_OPLOG_URL and ROOT_URL variables in HTTPS. Make it depend on MongoDB and expose port 3000 internally only.
Start and verify
Run docker compose up -d then docker compose logs -f rocketchat. The first startup migrates the MongoDB schema and can take one to two minutes. Wait for the message indicating that the server is ready on port 3000.
Set up reverse proxy and SSL
With Caddy: chat.yourdomain.com { reverse_proxy localhost:3000 }. With Nginx, proxy to 127.0.0.1:3000 forwarding the Upgrade/Connection headers for the WebSocket, then generate the certificate via certbot.
Finalize the admin setup
Open https://chat.yourdomain.com, complete the wizard (admin account, organization name, SMTP configuration). Disable public registration if the instance is private and configure the omnichannel module only if you need it.
The most common mistake when deploying Rocket.Chat is forgetting to initialize the MongoDB replica set: without rs.initiate(), the oplog is unavailable and real-time chat does not work. If you use the Bitnami image, pass MONGODB_REPLICA_SET_MODE=primary and MONGODB_REPLICA_SET_KEY. Also monitor the RAM consumed by MongoDB via docker stats: on a constrained VPS, cap the WiredTiger cache with --wiredTigerCacheSizeGB to prevent the database from suffocating the rest of the stack.
Rocket.Chat versus Mattermost
| Criterion | Rocket.Chat | Mattermost |
|---|---|---|
| Database | MongoDB (replica set required) | PostgreSQL |
| Memory footprint | More resource-hungry (MongoDB) | Leaner at equal load |
| Omnichannel / customer support | Built-in native module | Via third-party integrations |
| Audio/video calls | Built in | Via plugins / Calls (paid edition) |
| Federation | Matrix | Limited |
| App marketplace | Rich and native | Plugins, a more restricted catalog |
| Target audience | Unified communication + customer support | Technical teams and ChatOps |
| Setup | More configuration (replica set) | More straightforward with PostgreSQL |