Rocket.Chat Team Platform
Rocket.Chat team communication with MongoDB.
Overview
Rocket.Chat is an open-source team communication platform that provides organizations with complete control over their messaging infrastructure. Originally launched in 2015 as a self-hosted alternative to Slack and Microsoft Teams, Rocket.Chat offers real-time messaging, video conferencing, file sharing, and extensive customization options without vendor lock-in or data privacy concerns inherent in cloud-based solutions. The platform supports unlimited users, channels, and integrations while maintaining enterprise-grade security features like end-to-end encryption and compliance certifications. This deployment combines Rocket.Chat with MongoDB configured as a replica set, which is essential for Rocket.Chat's real-time features and data consistency. MongoDB's oplog (operations log) enables Rocket.Chat to track database changes in real-time, powering live message updates, presence indicators, and notification systems across all connected clients. The replica set configuration, even with a single node, provides the oplog functionality that Rocket.Chat requires for optimal performance. Organizations seeking complete control over their communication data will find this stack particularly valuable. Unlike hosted solutions, this deployment keeps all messages, files, and user data within your infrastructure, making it ideal for companies with strict data governance requirements, government agencies, healthcare organizations, or any team that prioritizes data sovereignty and customization flexibility over convenience.
Key Features
- Real-time messaging with MongoDB oplog integration for instant message delivery across all clients
- Built-in video conferencing and screen sharing capabilities without external dependencies
- Federation support allowing communication with other Rocket.Chat instances and Matrix protocol servers
- Extensive marketplace with hundreds of apps and integrations including Jira, GitHub, and Zapier
- Omnichannel customer service features with live chat widgets, WhatsApp, and SMS integration
- Advanced user management with LDAP/Active Directory sync and custom roles and permissions
- End-to-end encryption for private conversations and sensitive communications
- Thread-based discussions and message reactions for organized team collaboration
Common Use Cases
- 1Remote-first companies needing complete control over communication data and compliance
- 2Healthcare organizations requiring HIPAA-compliant team communication and patient consultation
- 3Government agencies and defense contractors with strict data sovereignty requirements
- 4Educational institutions managing student-teacher communication and virtual classrooms
- 5Software development teams integrating with GitHub, GitLab, and CI/CD pipelines
- 6Customer support organizations using omnichannel features for unified communication
- 7International organizations leveraging federation to connect distributed Rocket.Chat instances
Prerequisites
- Minimum 4GB RAM recommended (2GB for Rocket.Chat, 2GB for MongoDB with oplog operations)
- Docker and Docker Compose installed with sufficient storage for MongoDB data growth
- Port 3000 available for Rocket.Chat web interface access
- Understanding of MongoDB replica sets and oplog concepts for troubleshooting
- Valid domain name and SSL certificates for production deployments with federation
- Network configuration allowing MongoDB replica set initialization and internal communication
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 mongodb: 3 image: mongo:64 container_name: rocketchat-mongo5 restart: unless-stopped6 command: mongod --oplogSize 128 --replSet rs07 volumes: 8 - mongo_data:/data/db9 networks: 10 - rocketchat-network1112 mongo-init-replica: 13 image: mongo:614 container_name: mongo-init-replica15 command: >16 bash -c "sleep 10 && mongosh mongodb/rocketchat --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongodb:27017"}]})'"17 depends_on: 18 - mongodb19 networks: 20 - rocketchat-network2122 rocketchat: 23 image: rocket.chat:latest24 container_name: rocketchat25 restart: unless-stopped26 ports: 27 - "${ROCKETCHAT_PORT:-3000}:3000"28 environment: 29 - ROOT_URL=${ROOT_URL:-http://localhost:3000}30 - MONGO_URL=mongodb://mongodb:27017/rocketchat?replicaSet=rs031 - MONGO_OPLOG_URL=mongodb://mongodb:27017/local?replicaSet=rs032 - DEPLOY_METHOD=docker33 depends_on: 34 - mongodb35 networks: 36 - rocketchat-network3738volumes: 39 mongo_data: 4041networks: 42 rocketchat-network: 43 driver: bridge.env Template
.env
1# Rocket.Chat2ROCKETCHAT_PORT=30003ROOT_URL=http://localhost:3000Usage Notes
- 1Rocket.Chat at http://localhost:3000
- 2Setup wizard on first run
- 3Supports federation
- 4Many integrations available
Individual Services(3 services)
Copy individual services to mix and match with your existing compose files.
mongodb
mongodb:
image: mongo:6
container_name: rocketchat-mongo
restart: unless-stopped
command: mongod --oplogSize 128 --replSet rs0
volumes:
- mongo_data:/data/db
networks:
- rocketchat-network
mongo-init-replica
mongo-init-replica:
image: mongo:6
container_name: mongo-init-replica
command: |
bash -c "sleep 10 && mongosh mongodb/rocketchat --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongodb:27017"}]})'"
depends_on:
- mongodb
networks:
- rocketchat-network
rocketchat
rocketchat:
image: rocket.chat:latest
container_name: rocketchat
restart: unless-stopped
ports:
- ${ROCKETCHAT_PORT:-3000}:3000
environment:
- ROOT_URL=${ROOT_URL:-http://localhost:3000}
- MONGO_URL=mongodb://mongodb:27017/rocketchat?replicaSet=rs0
- MONGO_OPLOG_URL=mongodb://mongodb:27017/local?replicaSet=rs0
- DEPLOY_METHOD=docker
depends_on:
- mongodb
networks:
- rocketchat-network
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 mongodb:5 image: mongo:66 container_name: rocketchat-mongo7 restart: unless-stopped8 command: mongod --oplogSize 128 --replSet rs09 volumes:10 - mongo_data:/data/db11 networks:12 - rocketchat-network1314 mongo-init-replica:15 image: mongo:616 container_name: mongo-init-replica17 command: >18 bash -c "sleep 10 && mongosh mongodb/rocketchat --eval 'rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongodb:27017"}]})'"19 depends_on:20 - mongodb21 networks:22 - rocketchat-network2324 rocketchat:25 image: rocket.chat:latest26 container_name: rocketchat27 restart: unless-stopped28 ports:29 - "${ROCKETCHAT_PORT:-3000}:3000"30 environment:31 - ROOT_URL=${ROOT_URL:-http://localhost:3000}32 - MONGO_URL=mongodb://mongodb:27017/rocketchat?replicaSet=rs033 - MONGO_OPLOG_URL=mongodb://mongodb:27017/local?replicaSet=rs034 - DEPLOY_METHOD=docker35 depends_on:36 - mongodb37 networks:38 - rocketchat-network3940volumes:41 mongo_data:4243networks:44 rocketchat-network:45 driver: bridge46EOF4748# 2. Create the .env file49cat > .env << 'EOF'50# Rocket.Chat51ROCKETCHAT_PORT=300052ROOT_URL=http://localhost:300053EOF5455# 3. Start the services56docker compose up -d5758# 4. View logs59docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/rocketchat-team/run | bashTroubleshooting
- Rocket.Chat shows 'Cannot connect to database' error: Ensure MongoDB replica set is initialized by checking mongo-init-replica container logs and verifying rs.status() in MongoDB shell
- Real-time features not working (messages don't appear instantly): Verify MONGO_OPLOG_URL is correctly configured and MongoDB oplog is functioning with rs.printReplicationInfo()
- Rocket.Chat container fails to start with SIGKILL: Increase Docker memory limits as Rocket.Chat requires significant RAM during initialization, especially with MongoDB operations
- Federation or webhooks not working: Check ROOT_URL environment variable matches your actual domain and is accessible from external services
- MongoDB replica set fails to initialize: Ensure mongodb container is fully started before mongo-init-replica runs, increase sleep time if necessary
- File uploads failing or timing out: Verify sufficient disk space in mongo_data volume and adjust MongoDB's GridFS settings for large file handling
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
rocketchatmongodb
Tags
#rocketchat#chat#team#communication#mongodb
Category
Message Queues & BrokersAd Space
Shortcuts: C CopyF FavoriteD Download