Rocket.Chat Team Communication
Team communication platform with Rocket.Chat, MongoDB replica set, and Hubot integration.
Overview
Rocket.Chat is an open-source team communication platform that provides real-time messaging, file sharing, video conferencing, and collaboration features similar to Slack or Microsoft Teams. Originally launched in 2015, Rocket.Chat has become a popular self-hosted alternative for organizations seeking complete control over their communication infrastructure and data privacy. The platform supports unlimited users, channels, and messages while offering extensive customization options through apps, integrations, and API access.
This deployment combines Rocket.Chat with MongoDB's replica set configuration for high availability, Hubot for intelligent automation and bot interactions, and NGINX as a reverse proxy for SSL termination and load balancing. MongoDB replica sets ensure data redundancy and automatic failover, while Hubot extends the platform's functionality with automated responses, integrations, and workflow automation. NGINX handles incoming web traffic, provides SSL encryption, and can distribute load across multiple Rocket.Chat instances if needed.
This stack is ideal for development teams, remote organizations, and companies requiring on-premises chat solutions with enterprise-grade reliability. The combination provides everything needed for a production-ready team communication platform with bot automation capabilities, making it perfect for DevOps teams who want ChatOps integration, customer support teams needing bot assistance, and any organization prioritizing data sovereignty while maintaining modern collaboration features.
Key Features
- Real-time messaging with channels, direct messages, and threaded conversations
- MongoDB replica set with automatic failover and data redundancy
- Hubot integration for automated responses, ChatOps workflows, and custom bot commands
- Built-in video conferencing with screen sharing and recording capabilities
- File sharing with drag-and-drop uploads and image preview
- Extensive app marketplace with integrations for Jira, GitHub, GitLab, and CI/CD tools
- NGINX reverse proxy with SSL termination and WebSocket support
- Multi-language support with real-time translation capabilities
Common Use Cases
- 1DevOps teams implementing ChatOps workflows with automated deployment notifications and server monitoring
- 2Remote-first companies needing self-hosted communication platform with video conferencing
- 3Healthcare organizations requiring HIPAA-compliant messaging with end-to-end encryption
- 4Educational institutions providing secure student and faculty communication channels
- 5Customer support teams using Hubot for automated ticket creation and FAQ responses
- 6Open source projects coordinating development with integrated GitHub/GitLab notifications
- 7Government agencies requiring air-gapped communication systems with full data control
Prerequisites
- Minimum 4GB RAM (2GB for Rocket.Chat, 2GB for MongoDB replica set)
- SSL certificates for NGINX or domain configured for Let's Encrypt
- MongoDB root password and Hubot user credentials defined in environment variables
- Understanding of Rocket.Chat administration for initial setup and user management
- Basic knowledge of Hubot scripting for custom bot command development
- Ports 80, 443, and 3000 available for web traffic and Rocket.Chat access
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 rocketchat: 3 image: registry.rocket.chat/rocketchat/rocket.chat:latest4 environment: 5 ROOT_URL: ${ROOT_URL}6 PORT: 30007 MONGO_URL: mongodb://mongodb:27017/rocketchat?replicaSet=rs08 MONGO_OPLOG_URL: mongodb://mongodb:27017/local?replicaSet=rs09 DEPLOY_METHOD: docker10 DEPLOY_PLATFORM: docker-compose11 ports: 12 - "3000:3000"13 volumes: 14 - rocketchat_uploads:/app/uploads15 depends_on: 16 - mongodb17 networks: 18 - rocketchat-net19 restart: unless-stopped2021 mongodb: 22 image: bitnami/mongodb:5.023 environment: 24 MONGODB_REPLICA_SET_MODE: primary25 MONGODB_REPLICA_SET_NAME: rs026 MONGODB_PORT_NUMBER: 2701727 MONGODB_INITIAL_PRIMARY_HOST: mongodb28 MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 2701729 MONGODB_ADVERTISED_HOSTNAME: mongodb30 MONGODB_ROOT_PASSWORD: ${MONGODB_ROOT_PASSWORD}31 ALLOW_EMPTY_PASSWORD: "no"32 volumes: 33 - mongodb_data:/bitnami/mongodb34 networks: 35 - rocketchat-net36 restart: unless-stopped3738 hubot: 39 image: rocketchat/hubot-rocketchat:latest40 environment: 41 ROCKETCHAT_URL: rocketchat:300042 ROCKETCHAT_ROOM: GENERAL43 LISTEN_ON_ALL_PUBLIC: "true"44 ROCKETCHAT_USER: ${HUBOT_USER}45 ROCKETCHAT_PASSWORD: ${HUBOT_PASSWORD}46 BOT_NAME: rocketbot47 EXTERNAL_SCRIPTS: hubot-help,hubot-diagnostics48 depends_on: 49 - rocketchat50 networks: 51 - rocketchat-net52 restart: unless-stopped5354 nginx: 55 image: nginx:alpine56 ports: 57 - "80:80"58 - "443:443"59 volumes: 60 - ./nginx.conf:/etc/nginx/nginx.conf:ro61 - ./certs:/etc/nginx/certs:ro62 depends_on: 63 - rocketchat64 networks: 65 - rocketchat-net66 restart: unless-stopped6768volumes: 69 rocketchat_uploads: 70 mongodb_data: 7172networks: 73 rocketchat-net: 74 driver: bridge.env Template
.env
1# Rocket.Chat2ROOT_URL=https://chat.example.com34# MongoDB5MONGODB_ROOT_PASSWORD=secure_mongo_password67# Hubot (create user in Rocket.Chat first)8HUBOT_USER=rocketbot9HUBOT_PASSWORD=secure_bot_passwordUsage Notes
- 1Rocket.Chat at https://chat.example.com
- 2Create admin during first setup
- 3Create bot user for Hubot
- 4Supports video conferencing, file sharing
Individual Services(4 services)
Copy individual services to mix and match with your existing compose files.
rocketchat
rocketchat:
image: registry.rocket.chat/rocketchat/rocket.chat:latest
environment:
ROOT_URL: ${ROOT_URL}
PORT: 3000
MONGO_URL: mongodb://mongodb:27017/rocketchat?replicaSet=rs0
MONGO_OPLOG_URL: mongodb://mongodb:27017/local?replicaSet=rs0
DEPLOY_METHOD: docker
DEPLOY_PLATFORM: docker-compose
ports:
- "3000:3000"
volumes:
- rocketchat_uploads:/app/uploads
depends_on:
- mongodb
networks:
- rocketchat-net
restart: unless-stopped
mongodb
mongodb:
image: bitnami/mongodb:5.0
environment:
MONGODB_REPLICA_SET_MODE: primary
MONGODB_REPLICA_SET_NAME: rs0
MONGODB_PORT_NUMBER: 27017
MONGODB_INITIAL_PRIMARY_HOST: mongodb
MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 27017
MONGODB_ADVERTISED_HOSTNAME: mongodb
MONGODB_ROOT_PASSWORD: ${MONGODB_ROOT_PASSWORD}
ALLOW_EMPTY_PASSWORD: "no"
volumes:
- mongodb_data:/bitnami/mongodb
networks:
- rocketchat-net
restart: unless-stopped
hubot
hubot:
image: rocketchat/hubot-rocketchat:latest
environment:
ROCKETCHAT_URL: rocketchat:3000
ROCKETCHAT_ROOM: GENERAL
LISTEN_ON_ALL_PUBLIC: "true"
ROCKETCHAT_USER: ${HUBOT_USER}
ROCKETCHAT_PASSWORD: ${HUBOT_PASSWORD}
BOT_NAME: rocketbot
EXTERNAL_SCRIPTS: hubot-help,hubot-diagnostics
depends_on:
- rocketchat
networks:
- rocketchat-net
restart: unless-stopped
nginx
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./certs:/etc/nginx/certs:ro
depends_on:
- rocketchat
networks:
- rocketchat-net
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 rocketchat:5 image: registry.rocket.chat/rocketchat/rocket.chat:latest6 environment:7 ROOT_URL: ${ROOT_URL}8 PORT: 30009 MONGO_URL: mongodb://mongodb:27017/rocketchat?replicaSet=rs010 MONGO_OPLOG_URL: mongodb://mongodb:27017/local?replicaSet=rs011 DEPLOY_METHOD: docker12 DEPLOY_PLATFORM: docker-compose13 ports:14 - "3000:3000"15 volumes:16 - rocketchat_uploads:/app/uploads17 depends_on:18 - mongodb19 networks:20 - rocketchat-net21 restart: unless-stopped2223 mongodb:24 image: bitnami/mongodb:5.025 environment:26 MONGODB_REPLICA_SET_MODE: primary27 MONGODB_REPLICA_SET_NAME: rs028 MONGODB_PORT_NUMBER: 2701729 MONGODB_INITIAL_PRIMARY_HOST: mongodb30 MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 2701731 MONGODB_ADVERTISED_HOSTNAME: mongodb32 MONGODB_ROOT_PASSWORD: ${MONGODB_ROOT_PASSWORD}33 ALLOW_EMPTY_PASSWORD: "no"34 volumes:35 - mongodb_data:/bitnami/mongodb36 networks:37 - rocketchat-net38 restart: unless-stopped3940 hubot:41 image: rocketchat/hubot-rocketchat:latest42 environment:43 ROCKETCHAT_URL: rocketchat:300044 ROCKETCHAT_ROOM: GENERAL45 LISTEN_ON_ALL_PUBLIC: "true"46 ROCKETCHAT_USER: ${HUBOT_USER}47 ROCKETCHAT_PASSWORD: ${HUBOT_PASSWORD}48 BOT_NAME: rocketbot49 EXTERNAL_SCRIPTS: hubot-help,hubot-diagnostics50 depends_on:51 - rocketchat52 networks:53 - rocketchat-net54 restart: unless-stopped5556 nginx:57 image: nginx:alpine58 ports:59 - "80:80"60 - "443:443"61 volumes:62 - ./nginx.conf:/etc/nginx/nginx.conf:ro63 - ./certs:/etc/nginx/certs:ro64 depends_on:65 - rocketchat66 networks:67 - rocketchat-net68 restart: unless-stopped6970volumes:71 rocketchat_uploads:72 mongodb_data:7374networks:75 rocketchat-net:76 driver: bridge77EOF7879# 2. Create the .env file80cat > .env << 'EOF'81# Rocket.Chat82ROOT_URL=https://chat.example.com8384# MongoDB85MONGODB_ROOT_PASSWORD=secure_mongo_password8687# Hubot (create user in Rocket.Chat first)88HUBOT_USER=rocketbot89HUBOT_PASSWORD=secure_bot_password90EOF9192# 3. Start the services93docker compose up -d9495# 4. View logs96docker 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-stack/run | bashTroubleshooting
- MongoDB replica set initialization failed: Ensure MONGODB_REPLICA_SET_NAME matches MONGO_URL replicaSet parameter
- Rocket.Chat shows 'Cannot connect to database': Wait for MongoDB to fully initialize replica set before starting Rocket.Chat
- Hubot not responding to commands: Verify HUBOT_USER exists in Rocket.Chat and has appropriate channel permissions
- File uploads not persisting: Check that rocketchat_uploads volume is properly mounted and has write permissions
- NGINX 502 Bad Gateway: Confirm Rocket.Chat container is running and accessible on port 3000 within Docker network
- Video calls not working: Ensure WebRTC ports are open and STUN/TURN servers are configured in Rocket.Chat admin panel
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
rocketchatmongodbhubotnginx
Tags
#rocketchat#chat#team#mongodb#collaboration
Category
Productivity & CollaborationAd Space
Shortcuts: C CopyF FavoriteD Download