Categories: Linux

How to Install Rocket Chat with Docker Compose

Introduction

Hey there! Today we’re diving into Rocket.Chat, a communication tool that keeps your team connected and productive.

What is Rocket.Chat?

Think of it as a central hub for your team. You can chat with colleagues instantly, share files, and even hop on video calls without needing a bunch of different apps.

Why Rocket.Chat? Here’s what makes it awesome:

  • Chat like a boss: Rocket.Chat lets you chat with your team one-on-one or in groups. Need to brainstorm with a specific team? Create a channel for it!
  • Video calls made easy: No more juggling multiple apps. Rocket.Chat has built-in video calling, so you can chat face-to-face with your team without ever leaving the platform.
  • Share files securely: Need to share documents, images, or presentations? Rocket.Chat lets you do it all within the platform, so everything stays organized and accessible.
  • Works on any device: Catch up on chats or join a call from your computer, phone, or tablet. Rocket.Chat is super flexible!
  • Make it yours: Don’t like the default settings? No problem! Rocket.Chat lets you customize your workspace with widgets, apps, and extensions to fit your team’s needs.

More than just chat: Rocket.Chat goes beyond simple messaging. Here are some ways it can help your team:

  • Boost business collaboration: Streamline communication and teamwork with features like video calls, file sharing, and integrations with your favorite business tools.
  • Perfect for remote teams: Stay connected and productive even if your team is scattered around the world.
  • Educate and connect: Schools and universities can use Rocket.Chat to facilitate online learning, group projects, and discussions among students and teachers.
  • Build stronger communities: Rocket.Chat is a great tool for non-profits, online groups, and social communities to connect and collaborate.

Supercharge Rocket.Chat with Plugins:

Rocket.Chat has a marketplace filled with cool add-ons that make it even more powerful. Here are a few examples:

  • Chatbots can answer common questions and automate tasks, saving you time.
  • Zapier integration connects Rocket.Chat with thousands of other apps, so you can automate workflows and reduce busywork.
  • Jitsi Meet integration allows for high-quality video conferencing right within Rocket.Chat.
  • Omnichannel Live Chat lets customer support teams manage chats from various channels, all in one place.

Installation

In this step-by-step guide, we’ll walk you through the process of installing Rocket.Chat on Ubuntu 20.04 LTS using Docker Compose. We will also cover the prerequisites, including installing Docker and Docker Compose, configuring firewall rules for Rocket.Chat, setting up Nginx Proxy Manager, issuing an SSL certificate, and creating an administrator account.

Prerequisites

Before installing Rocket.Chat, you’ll need to have the following prerequisites in place:

  1. Ubuntu 20.04 LTS Server: Make sure you have a clean Ubuntu 20.04 LTS server with root or sudo access. Server has minimum 2 CPU Core and 4 GB Ram.
  2. Docker and Docker Compose Installation: follow these step
nano doc.sh 

## and paste below code 
##########
apt update && 
apt upgrade -y &&
curl -fsSL https://get.docker.com -o get-docker.sh &&
sudo sh get-docker.sh &&
curl -SL https://github.com/docker/compose/releases/download/v2.13.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose &&
chmod +x /usr/local/bin/docker-compose &&
apt-get install docker-compose-plugin
##########

## to save changing press >> CTRL + X >> Y >> Enter
## change the file mode to executable 
chmod +x doc.sh

## Run this script
./doc.sh

## check version of Docker  & Docker-Compose
docker -v
docker-compose.yml
  1. Firewall Rules: Configure your firewall to allow traffic on the necessary ports. Rocket.Chat typically uses port 3000 for HTTP. You can open the port using the following commands:
ufw allow 22/tcp
ufw allow 80/tcp
ufw allow 443/tcp
ufw allow 3000/tcp
ufw allow 81/tcp
ufw status

## If firewall is “inactive” state then press “Y” to enable the firewall
ufw enable

## check again
ufw status
  1. Nginx Proxy Manager: We will use Nginx Proxy Manager to manage SSL certificates and reverse proxy traffic to Rocket.Chat. Install it with Docker Compose, as described later.

Rocket Chat installation

## Create a directory for Rocket.Chat
mkdir ~/rocket-chat
cd ~/rocket-chat

## you can use the curl command to download the example docker-compose.yml file by executing this command
curl -L https://raw.githubusercontent.com/RocketChat/Docker.Official.Image/master/compose.yml -O

## create .env file 
nano .env

## paste the below code 

#############

### Rocket.Chat configuration

# Rocket.Chat version
# see:- https://github.com/RocketChat/Rocket.Chat/releases
#RELEASE=
# MongoDB endpoint (include ?replicaSet= parameter)
#MONGO_URL=
# MongoDB endpoint to the local database
#MONGO_OPLOG_URL=
# IP to bind the process to
#BIND_IP=
# URL used to access your Rocket.Chat instance
#ROOT_URL=
# Port Rocket.Chat runs on (in-container)
#PORT=
# Port on the host to bind to
#HOST_PORT=

### MongoDB configuration
# MongoDB version/image tag
#MONGODB_VERSION=
# See:- https://hub.docker.com/r/bitnami/mongodb

### Traefik config (if enabled)
# Traefik version/image tag
#TRAEFIK_RELEASE=
# Domain for https (change ROOT_URL & BIND_IP accordingly)
#DOMAIN=
# Email for certificate notifications
#LETSENCRYPT_EMAIL=

#########

## to save changes press >> Ctrl + X >> Y >> Enter

## now run docker compose without any changes in .env and compose.yml file
docker compose up -d

Open a web browser and navigate to your Rocket.Chat domain http://Server-IP:3000

Installing Nginx Proxy Manager

To set up Nginx Proxy Manager, follow these steps:

## Create a directory to store Nginx Proxy Manager configurations
mkdir ~/nginx-proxy-manager
cd ~/nginx-proxy-manager

## Create a docker-compose.yml file for Nginx Proxy Manager:
nano docker-compose.yml

## Paste the below code

version: '3.8'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt

## Save changes with Press Ctrl + X >> Y >> Enter
## Run Nginx Proxy Manager 
docker-compose up -d

Open a web browser and navigate to your Nginx Proxy Manager domain http://Server-IP:81

Issuing an SSL Certificate

  1. Access the Nginx Proxy Manager web interface by opening a browser and navigating to http://your_server_ip. Log in with the default credentials (admin@example.com and changeme) and change your password.
  2. Go to the “Proxy Hosts” section and add a new proxy host for your Rocket.Chat instance. Specify the domain or subdomain you want to use (e.g., chat.example.com), and make sure to enable “Force SSL” and “HSTS.”
  3. In the SSL Certificates tab, request a new SSL certificate for the proxy host you just created.
  4. Once the certificate is issued, it will be automatically configured SSL Certificate for your Rocket.Chat instance.

Note: If you face any problem to run this code you also watch my Video tutorial

Accessing the Rocket.Chat Server and Creating an Administrator Account

  1. Open a web browser and navigate to your Rocket.Chat domain (e.g., https://chat.example.com).
  2. You will see the Rocket.Chat setup page. Set your administrator username, password, and other configurations.
  3. Once the setup is complete, you can log in with your administrator account and start using Rocket.Chat.

Additional Configuration and Maintenance

After successfully setting up Rocket.Chat, there are some additional configuration and maintenance tasks you might want to consider:

Configure Email Settings

To enable email notifications and password reset functionality, configure your SMTP settings in Rocket.Chat. You can access these settings in the Rocket.Chat admin panel under “Settings” > “Email.”

User Management

You can manage users, create channels, and set up permissions through the Rocket.Chat admin panel. This is where you can add new users, set user roles, and customize your collaboration environment.

Backup and Data Management

Regularly back up your Rocket.Chat data to ensure data security. You can use Docker volume backups or explore other backup solutions to safeguard your chat data.

Rocket.Chat Updates

Keep your Rocket.Chat instance up to date by periodically checking for updates and applying them as necessary. You can do this by pulling the latest Docker image and recreating the container.

shellCopy code

docker-compose pull rocketchat docker-compose up -d

Nginx Proxy Manager Updates

Similarly, you should also check for Nginx Proxy Manager updates and apply them as needed. This ensures that your SSL certificates remain valid and secure.

Troubleshooting

If you encounter any issues with Rocket.Chat or Nginx Proxy Manager, you can check their respective logs for error messages to identify and resolve problems:

## Rocket.Chat logs
docker-compose logs -f rocketchat

## Nginx Proxy Manager logs
docker-compose logs -f app

Advanced Configuration

For more advanced configurations or specific requirements, refer to the official Rocket.Chat documentation and Nginx Proxy Manager documentation. You can fine-tune your setup to meet your organization’s needs.

Security Considerations

Security should be a top priority. Regularly review and update your server’s security measures, including server updates, firewall rules, and user access. Consider enabling two-factor authentication (2FA) for Rocket.Chat users to enhance security.

By following these additional steps and best practices, you can ensure your Rocket.Chat installation remains secure, functional, and tailored to your specific collaboration needs. Rocket.Chat is a versatile platform that can serve as the backbone for team communication, and it’s important to maintain it effectively for your organization.

Watch Video Tutorial:

Confused about setting up your own Rocket Chat? Ditch the dry guides and watch my video tutorial

  • Clear, concise instructions in Urdu/Hindi with English subtitles for everyone.
  • Visual demonstration makes every step crystal clear.
  • Time-saving guide gets you up and running fast.
kash

Recent Posts

How to Install Rallly with Docker Compose

What is Rallly? Rallly is an open-source scheduling and collaboration tool designed to make it…

2 weeks ago

How to Install OpenProject: A Step-by-Step Guide for Beginners

Introduction OpenProject is a project management tool designed to help teams organize, collaborate, and track…

2 months ago

Part 2: Jitsi Meet Host Authentication & JWT Token Configuration

Hey there! Welcome back to the website, and today we're diving deeper into Jitsi Meet.…

7 months ago

Self-Hosted Chat: Set Up Your Own Mattermost Server with Ease

Introduction Boost your team's collaboration and productivity with Mattermost, a secure and versatile communication platform.…

9 months ago

How to install n8n in Linux using Docker-Compose

Introduction n8n.io is your secret weapon for workflow automation! It's a user-friendly platform that lets…

10 months ago

How to Install Nextcloud All-in-One on Linux

What is Nextcloud? Nextcloud is an awesome open-source platform that gives you exactly that. Think…

11 months ago