docker.recipes

Rocket.Chat Team Communication

intermediate

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:latest
4 environment:
5 ROOT_URL: ${ROOT_URL}
6 PORT: 3000
7 MONGO_URL: mongodb://mongodb:27017/rocketchat?replicaSet=rs0
8 MONGO_OPLOG_URL: mongodb://mongodb:27017/local?replicaSet=rs0
9 DEPLOY_METHOD: docker
10 DEPLOY_PLATFORM: docker-compose
11 ports:
12 - "3000:3000"
13 volumes:
14 - rocketchat_uploads:/app/uploads
15 depends_on:
16 - mongodb
17 networks:
18 - rocketchat-net
19 restart: unless-stopped
20
21 mongodb:
22 image: bitnami/mongodb:5.0
23 environment:
24 MONGODB_REPLICA_SET_MODE: primary
25 MONGODB_REPLICA_SET_NAME: rs0
26 MONGODB_PORT_NUMBER: 27017
27 MONGODB_INITIAL_PRIMARY_HOST: mongodb
28 MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 27017
29 MONGODB_ADVERTISED_HOSTNAME: mongodb
30 MONGODB_ROOT_PASSWORD: ${MONGODB_ROOT_PASSWORD}
31 ALLOW_EMPTY_PASSWORD: "no"
32 volumes:
33 - mongodb_data:/bitnami/mongodb
34 networks:
35 - rocketchat-net
36 restart: unless-stopped
37
38 hubot:
39 image: rocketchat/hubot-rocketchat:latest
40 environment:
41 ROCKETCHAT_URL: rocketchat:3000
42 ROCKETCHAT_ROOM: GENERAL
43 LISTEN_ON_ALL_PUBLIC: "true"
44 ROCKETCHAT_USER: ${HUBOT_USER}
45 ROCKETCHAT_PASSWORD: ${HUBOT_PASSWORD}
46 BOT_NAME: rocketbot
47 EXTERNAL_SCRIPTS: hubot-help,hubot-diagnostics
48 depends_on:
49 - rocketchat
50 networks:
51 - rocketchat-net
52 restart: unless-stopped
53
54 nginx:
55 image: nginx:alpine
56 ports:
57 - "80:80"
58 - "443:443"
59 volumes:
60 - ./nginx.conf:/etc/nginx/nginx.conf:ro
61 - ./certs:/etc/nginx/certs:ro
62 depends_on:
63 - rocketchat
64 networks:
65 - rocketchat-net
66 restart: unless-stopped
67
68volumes:
69 rocketchat_uploads:
70 mongodb_data:
71
72networks:
73 rocketchat-net:
74 driver: bridge

.env Template

.env
1# Rocket.Chat
2ROOT_URL=https://chat.example.com
3
4# MongoDB
5MONGODB_ROOT_PASSWORD=secure_mongo_password
6
7# Hubot (create user in Rocket.Chat first)
8HUBOT_USER=rocketbot
9HUBOT_PASSWORD=secure_bot_password

Usage Notes

  1. 1Rocket.Chat at https://chat.example.com
  2. 2Create admin during first setup
  3. 3Create bot user for Hubot
  4. 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 file
2cat > docker-compose.yml << 'EOF'
3services:
4 rocketchat:
5 image: registry.rocket.chat/rocketchat/rocket.chat:latest
6 environment:
7 ROOT_URL: ${ROOT_URL}
8 PORT: 3000
9 MONGO_URL: mongodb://mongodb:27017/rocketchat?replicaSet=rs0
10 MONGO_OPLOG_URL: mongodb://mongodb:27017/local?replicaSet=rs0
11 DEPLOY_METHOD: docker
12 DEPLOY_PLATFORM: docker-compose
13 ports:
14 - "3000:3000"
15 volumes:
16 - rocketchat_uploads:/app/uploads
17 depends_on:
18 - mongodb
19 networks:
20 - rocketchat-net
21 restart: unless-stopped
22
23 mongodb:
24 image: bitnami/mongodb:5.0
25 environment:
26 MONGODB_REPLICA_SET_MODE: primary
27 MONGODB_REPLICA_SET_NAME: rs0
28 MONGODB_PORT_NUMBER: 27017
29 MONGODB_INITIAL_PRIMARY_HOST: mongodb
30 MONGODB_INITIAL_PRIMARY_PORT_NUMBER: 27017
31 MONGODB_ADVERTISED_HOSTNAME: mongodb
32 MONGODB_ROOT_PASSWORD: ${MONGODB_ROOT_PASSWORD}
33 ALLOW_EMPTY_PASSWORD: "no"
34 volumes:
35 - mongodb_data:/bitnami/mongodb
36 networks:
37 - rocketchat-net
38 restart: unless-stopped
39
40 hubot:
41 image: rocketchat/hubot-rocketchat:latest
42 environment:
43 ROCKETCHAT_URL: rocketchat:3000
44 ROCKETCHAT_ROOM: GENERAL
45 LISTEN_ON_ALL_PUBLIC: "true"
46 ROCKETCHAT_USER: ${HUBOT_USER}
47 ROCKETCHAT_PASSWORD: ${HUBOT_PASSWORD}
48 BOT_NAME: rocketbot
49 EXTERNAL_SCRIPTS: hubot-help,hubot-diagnostics
50 depends_on:
51 - rocketchat
52 networks:
53 - rocketchat-net
54 restart: unless-stopped
55
56 nginx:
57 image: nginx:alpine
58 ports:
59 - "80:80"
60 - "443:443"
61 volumes:
62 - ./nginx.conf:/etc/nginx/nginx.conf:ro
63 - ./certs:/etc/nginx/certs:ro
64 depends_on:
65 - rocketchat
66 networks:
67 - rocketchat-net
68 restart: unless-stopped
69
70volumes:
71 rocketchat_uploads:
72 mongodb_data:
73
74networks:
75 rocketchat-net:
76 driver: bridge
77EOF
78
79# 2. Create the .env file
80cat > .env << 'EOF'
81# Rocket.Chat
82ROOT_URL=https://chat.example.com
83
84# MongoDB
85MONGODB_ROOT_PASSWORD=secure_mongo_password
86
87# Hubot (create user in Rocket.Chat first)
88HUBOT_USER=rocketbot
89HUBOT_PASSWORD=secure_bot_password
90EOF
91
92# 3. Start the services
93docker compose up -d
94
95# 4. View logs
96docker compose logs -f

One-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 | bash

Troubleshooting

  • 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

Ad Space