CHECKING STATUS
I AM LISTENING TO
|

Day 18: Rocket.Chat – Open-Source Communication Platform – 7 Days of Docker

11. March 2025
.SHARE

Table of Contents

Rocket.Chat is one of the leading open-source communication platforms for organizations that require high standards of data protection and customization capabilities. In this comprehensive guide, we’ll walk through how to deploy Rocket.Chat using Docker and Docker Compose, providing you with a robust, scalable, and secure chat solution that you can self-host.

I have been running it on multiple systems for years. Started with a local direct install and moved to Docker about 3 years ago. Running the latest release with MongoDB 6 at the moment, it had problems with MongoDB 7 last year and I am not switching yet. With Rocket.Chat 8.x, they will deprecate MongoDB 5.

Introduction to Rocket.Chat

Rocket.Chat is a fully customizable communications platform developed in JavaScript. It offers features like:

  • Real-time chat with individual and group messaging
  • File sharing and media embedding
  • Voice and video calls
  • Screen sharing
  • Integration with popular services and third-party applications
  • End-to-end encryption
  • Self-hosting options for complete data control

Unlike proprietary solutions, Rocket.Chat gives you full control over your data and allows for extensive customization to match your organization’s specific needs.

System Requirements

Before installing Rocket.Chat, ensure your server meets the minimum requirements. Requirements vary based on your expected usage:

For Small Teams (up to 50 concurrent users)

  • 2 vCPUs (minimum)
  • 2GB RAM (minimum)
  • 10GB of storage for MongoDB
  • 3GB minimum disk space for the Rocket.Chat application

For Medium Deployments (50-500 concurrent users)

  • 4 vCPUs
  • 8GB RAM
  • 40GB+ of storage for MongoDB
  • 5GB+ disk space for the Rocket.Chat application

For Large Deployments (500-5000 concurrent users)

  • 8+ vCPUs
  • 16GB+ RAM
  • 80GB+ of storage for MongoDB
  • 10GB+ disk space for the Rocket.Chat application

For Enterprise Deployments (5000+ concurrent users)

  • 16+ vCPUs
  • 32GB+ RAM
  • Custom MongoDB deployment with replication and sharding
  • Specialized server architecture

Note: For file storage in production environments, Rocket.Chat recommends using object storage services such as Amazon S3, Google Cloud Storage, or MinIO instead of GridFS.

Prerequisites

Before proceeding with the installation, ensure you have:

  1. A server running Linux (Ubuntu Server 22.04 LTS recommended)
  2. Docker Engine installed (version 20.10 or newer)
  3. Docker Compose installed (version 2.0 or newer)
  4. A domain name pointing to your server’s IP address
  5. Ports 80 and 443 open in your firewall for HTTP/HTTPS access

Installing Docker and Docker Compose

If you don’t have Docker already installed, you can install it with:

Verify the installations:

Installation Methods

There are several approaches to deploy Rocket.Chat with Docker:

  1. Using the official Docker image with a simple docker run command
  2. Using Docker Compose with a basic configuration
  3. Using Docker Compose with Traefik for reverse proxy and automatic SSL

This guide focuses on the Docker Compose approach as it provides the best balance of simplicity and flexibility.

Setting Up with Docker Compose

We’ll use Docker Compose to set up Rocket.Chat with MongoDB (required database) and Traefik as a reverse proxy for handling SSL certificates.

Step 1: Create Project Directory

First, create a directory for your Rocket.Chat deployment:

Step 2: Create Docker Networks

Create the necessary Docker networks:

Step 3: Create .env File

Create a .env file to store environment variables:

Add the following content, making sure to replace the example values with your own:

Step 4: Create Docker Compose File

Create a docker-compose.yml file:

Add the following content:

Step 5: Deploy Rocket.Chat

Start the deployment with Docker Compose:

This command will:

  1. Pull the required Docker images
  2. Create necessary volumes
  3. Set up MongoDB with a replica set for Rocket.Chat
  4. Configure Traefik for HTTPS and reverse proxy
  5. Start the Rocket.Chat service

Step 6: Verify the Deployment

Check if the containers are running:

You should see three containers running:

  • MongoDB
  • Rocket.Chat
  • Traefik

Check the logs for any errors:

Post-Installation Steps

Setting Up the Admin Account

  1. Open your browser and navigate to your Rocket.Chat URL (https://chat.yourdomain.com)
  2. Follow the on-screen instructions to set up your admin account
  3. Create your organization profile
  4. Register your server (optional, but recommended for notifications)

Configuring SMTP for Email Notifications

To enable email notifications in Rocket.Chat:

  1. Log in with your admin account
  2. Go to Administration > Email > SMTP
  3. Fill in your SMTP server details:
    • Protocol: SMTP (or SMTPS if required)
    • Host: your.smtp-server.com
    • Port: 587 (or as required by your SMTP provider)
    • Username & Password: Your SMTP credentials
    • From Email: noreply@yourdomain.com (or your preferred sending address)
  4. Save the settings and send a test email

Maintenance and Backups

Backing Up Rocket.Chat

Regularly back up your Rocket.Chat instance:

  1. MongoDB data (the most critical component)
  2. Uploaded files
  3. Custom configurations

Here’s a simple backup script you can adapt:

Updating Rocket.Chat

To update to a newer version:

  1. Update the image tag in your .env file to the desired version
  2. Run the following commands:

Troubleshooting

Common Issues and Solutions

  1. MongoDB Connection Errors
    • Check MongoDB container logs: docker logs rocketchat_mongodb_1
    • Verify replica set is properly initialized
    • Check network connectivity between containers
  2. Rocket.Chat Can’t Start
    • Verify MongoDB is healthy: docker ps (should show status as “healthy”)
    • Check Rocket.Chat logs: docker logs rocketchat_rocketchat_1
    • Ensure environment variables are correctly set
  3. SSL Certificate Issues
    • Verify DNS records point to your server
    • Check Traefik logs: docker logs rocketchat_traefik_1
    • Make sure ports 80 and 443 are open on your firewall
  4. High Resource Usage
    • MongoDB may require tuning for larger deployments
    • Consider scaling vertically (larger server) or horizontally (multiple instances)
    • Use monitoring tools to identify bottlenecks

Thoughts

You’ve now successfully deployed Rocket.Chat using Docker and Docker Compose with a proper reverse proxy setup for HTTPS. This setup provides:

  • A secure communication platform with SSL encryption
  • Automatic certificate management with Let’s Encrypt
  • Efficient containerization with Docker
  • Proper database setup with MongoDB
  • Easy maintenance and updates

For more advanced configurations and optimizations, refer to the official Rocket.Chat documentation.


Additional Resources

Let’s Talk!

Looking for a reliable partner to bring your project to the next level? Whether it’s development, design, security, or ongoing support—I’d love to chat and see how I can help.

Get in touch,
and let’s create something amazing together!

RELATED POSTS

In today’s fast-paced digital world, staying on top of website changes can be crucial for various reasons—whether you’re hunting for product restocks, monitoring pricing changes, tracking competitors, or keeping an eye on regulatory updates. Enter ChangeDetection.io, an open-source solution that makes website change monitoring accessible, efficient, and incredibly powerful. What is ChangeDetection.io? ChangeDetection.io is a […]

Are JavaScript polyfills still relevant in today’s development landscape? It’s a question I get asked frequently in consultations and tech discussions, especially as browsers have become more standardized. Let me break this down for you with some real-world perspective. What Are JavaScript Polyfills (And Why We Used to Need Them) If you’ve been in web […]

Maintaining up-to-date Docker containers is critical for security and functionality, but manually updating containers across all your deployments can be tedious and error-prone. This is where Watchtower comes in – a powerful tool that automates the process of keeping your Docker containers fresh and updated. “I am actively using it locally and externally on my […]

Alexander

I am a full-stack developer. My expertise include:

  • Server, Network and Hosting Environments
  • Data Modeling / Import / Export
  • Business Logic
  • API Layer / Action layer / MVC
  • User Interfaces
  • User Experience
  • Understand what the customer and the business needs


I have a deep passion for programming, design, and server architecture—each of these fuels my creativity, and I wouldn’t feel complete without them.

With a broad range of interests, I’m always exploring new technologies and expanding my knowledge wherever needed. The tech world evolves rapidly, and I love staying ahead by embracing the latest innovations.

Beyond technology, I value peace and surround myself with like-minded individuals.

I firmly believe in the principle: Help others, and help will find its way back to you when you need it.