How to Install Rocket.Chat on Fedora

Install Rocket.Chat on Fedora

Are you looking to set up your own team communication platform? Rocket.Chat is an excellent open-source alternative to Slack and Microsoft Teams, offering complete control over your data and communications. Installing Rocket.Chat on Fedora might seem daunting, but I’ll walk you through every step of the process in this comprehensive guide.

Whether you’re a system administrator, developer, or just someone who wants to host their own chat server, this tutorial will get you up and running with a fully functional Rocket.Chat installation on your Fedora system.

What is Rocket.Chat and Why Use It?

Rocket.Chat is a powerful, open-source team communication platform that provides real-time chat, video conferencing, file sharing, and collaboration tools. Think of it as your own private Slack that you can customize and control completely.

Here’s why you might choose Rocket.Chat for your organization:

  • Complete data ownership – Your conversations stay on your servers
  • Unlimited users and messages – No subscription limits
  • Extensive customization options – Modify the platform to fit your needs
  • Strong security features – End-to-end encryption and compliance options
  • Cost-effective – Avoid monthly subscription fees for large teams

The platform serves over 12 million users worldwide and is trusted by organizations ranging from startups to Fortune 500 companies. It’s particularly popular among teams that prioritize privacy and data sovereignty.

System Requirements for Rocket.Chat on Fedora

Before diving into the installation process, let’s ensure your Fedora system meets the necessary requirements.

Hardware Requirements

For a small to medium deployment (up to 200 users), you’ll need:

  • RAM: Minimum 2GB, recommended 4GB or more
  • CPU: 2+ cores recommended
  • Storage: At least 20GB free space (more for file uploads and logs)
  • Network: Stable internet connection

For larger deployments, scale these requirements accordingly. A production environment serving 1000+ users typically requires 8GB+ RAM and dedicated server resources.

Software Prerequisites

Your Fedora system should have:

  • Fedora 35 or newer (this guide works with Fedora 36, 37, and 38)
  • Root or sudo access for system configuration
  • Basic command line familiarity – don’t worry, I’ll explain each step

Preparing Your Fedora System

Let’s start by getting your system ready for the installation process.

Updating System Packages

First, ensure your system is up to date. This prevents compatibility issues and security vulnerabilities:

sudo dnf update -y

This command updates all installed packages to their latest versions. The -y flag automatically confirms any prompts, making the process seamless.

Installing Essential Tools

We’ll need several tools during the installation process:

sudo dnf install -y curl wget gnupg2 software-properties-common

These tools will help us download files, add repositories, and manage GPG keys throughout the installation process.

Installing MongoDB on Fedora

MongoDB serves as Rocket.Chat’s database backend. It’s where all your messages, user data, and configurations are stored.

Adding MongoDB Repository

MongoDB isn’t available in Fedora’s default repositories, so we need to add the official MongoDB repository:

sudo tee /etc/yum.repos.d/mongodb-org-6.0.repo << EOF
[mongodb-org-6.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/6.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc
EOF

This creates a repository configuration file that tells dnf where to find MongoDB packages.

Installing and Configuring MongoDB

Now install MongoDB:

sudo dnf install -y mongodb-org

Starting MongoDB Service

Enable and start the MongoDB service:

sudo systemctl enable mongod
sudo systemctl start mongod

Verify that MongoDB is running:

sudo systemctl status mongod

You should see an “active (running)” status, indicating MongoDB is working correctly.

Creating MongoDB Database and User

Connect to MongoDB and create a dedicated database for Rocket.Chat:

mongosh

In the MongoDB shell, run these commands:

use rocketchat
db.createUser({
  user: "rocketchat",
  pwd: "your-secure-password-here",
  roles: [{role: "dbOwner", db: "rocketchat"}]
})
exit

Important: Replace your-secure-password-here with a strong, unique password. Write it down – you’ll need it later.

Installing Node.js and npm

Node.js is the runtime environment that powers Rocket.Chat. The platform requires a specific Node.js version for optimal performance.

Installing Node.js via NodeSource Repository

Rocket.Chat works best with Node.js version 14.x. Let’s install it from the NodeSource repository:

curl -fsSL https://rpm.nodesource.com/setup_14.x | sudo bash -
sudo dnf install -y nodejs

This method ensures we get the correct Node.js version with all necessary dependencies.

Verifying Node.js Installation

Check that Node.js and npm are installed correctly:

node --version
npm --version

You should see version numbers for both commands. Node.js should show v14.x.x, and npm should display version 6.x.x or higher.

Downloading and Installing Rocket.Chat

Now comes the exciting part – installing Rocket.Chat itself!

Creating Rocket.Chat User

For security purposes, create a dedicated user to run Rocket.Chat:

sudo useradd -r -s /bin/false rocketchat

This creates a system user without shell access, following security best practices.

Downloading Rocket.Chat Source Code

Download the latest stable version of Rocket.Chat:

cd /tmp
curl -L https://releases.rocket.chat/latest/download -o rocket.chat.tgz

Extract and move it to the installation directory:

tar -xzf rocket.chat.tgz
sudo mv bundle /opt/Rocket.Chat
sudo chown -R rocketchat:rocketchat /opt/Rocket.Chat

Installing Dependencies

Navigate to the Rocket.Chat directory and install the required Node.js packages:

cd /opt/Rocket.Chat/programs/server
sudo -u rocketchat npm install

This process may take several minutes as npm downloads and compiles all necessary dependencies. Be patient – it’s building your chat platform!

Configuring Rocket.Chat

Configuration is crucial for a smooth-running Rocket.Chat installation.

Setting Environment Variables

Create a configuration file with environment variables:

sudo tee /opt/Rocket.Chat/.env << EOF
ROOT_URL=http://your-domain.com
PORT=3000
MONGO_URL=mongodb://rocketchat:your-secure-password-here@localhost:27017/rocketchat
MONGO_OPLOG_URL=mongodb://rocketchat:your-secure-password-here@localhost:27017/local?authSource=rocketchat
EOF

Replace the following:

  • your-domain.com with your actual domain name
  • your-secure-password-here with the MongoDB password you created earlier

Creating Systemd Service File

To manage Rocket.Chat as a system service, create a systemd service file:

sudo tee /etc/systemd/system/rocketchat.service << EOF
[Unit]
Description=Rocket.Chat Server
After=network.target mongodb.service

[Service]
Type=simple
User=rocketchat
Group=rocketchat
WorkingDirectory=/opt/Rocket.Chat
EnvironmentFile=/opt/Rocket.Chat/.env
ExecStart=/usr/bin/node main.js
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
EOF

Service File Configuration

This service file tells systemd:

  • To start Rocket.Chat after the network and MongoDB are ready
  • To run as the rocketchat user for security
  • To automatically restart if the service crashes
  • To load environment variables from our .env file

Starting Rocket.Chat Service

Let’s fire up your new chat server!

Enabling and Starting the Service

Reload systemd and start Rocket.Chat:

sudo systemctl daemon-reload
sudo systemctl enable rocketchat
sudo systemctl start rocketchat

Checking Service Status

Verify that Rocket.Chat is running:

sudo systemctl status rocketchat

You should see “active (running)” status. If there are errors, check the logs:

sudo journalctl -u rocketchat -f

The -f flag follows the log in real-time, helping you troubleshoot any startup issues.

Configuring Nginx as Reverse Proxy

While Rocket.Chat runs on port 3000, it’s best practice to use a reverse proxy like Nginx for production deployments.

Installing Nginx

Install Nginx on your Fedora system:

sudo dnf install -y nginx

Creating Nginx Configuration

Create a virtual host configuration for Rocket.Chat:

sudo tee /etc/nginx/conf.d/rocketchat.conf << EOF
upstream rocketchat {
    server 127.0.0.1:3000;
}

server {
    listen 80;
    server_name your-domain.com;

    location / {
        proxy_pass http://rocketchat;
        proxy_http_version 1.1;
        proxy_set_header Upgrade \$http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host \$host;
        proxy_set_header X-Real-IP \$remote_addr;
        proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto \$scheme;
    }
}
EOF

Replace your-domain.com with your actual domain name.

Start and enable Nginx:

sudo systemctl enable nginx
sudo systemctl start nginx

SSL Configuration with Let’s Encrypt

For production use, secure your installation with SSL. Install Certbot:

sudo dnf install -y certbot python3-certbot-nginx

Obtain an SSL certificate:

sudo certbot --nginx -d your-domain.com

Follow the prompts to configure automatic renewal.

Initial Rocket.Chat Setup

Your Rocket.Chat server should now be accessible!

Accessing the Web Interface

Open your web browser and navigate to http://your-domain.com (or https://your-domain.com if you configured SSL).

You should see the Rocket.Chat setup wizard. If you see an error, double-check that:

  • Rocket.Chat service is running
  • MongoDB is running
  • Nginx is properly configured
  • Your domain’s DNS points to your server

Admin Account Creation

The setup wizard will guide you through:

  1. Organization Information – Enter your organization’s name and details
  2. Admin User – Create your first administrator account
  3. Server Configuration – Set basic server preferences
  4. Register Server – Optionally register with Rocket.Chat Cloud for additional features

Take your time with these settings – you can modify most of them later through the admin panel.

Basic Configuration Settings

After initial setup, explore the Administration Panel to configure:

  • General settings – Site name, language, timezone
  • Accounts – User registration policies, login methods
  • Message – Message limits, file upload settings
  • Email – SMTP configuration for notifications

Troubleshooting Common Issues

Even with careful installation, you might encounter some hiccups. Here are solutions to common problems:

Port Conflicts

If port 3000 is already in use:

sudo netstat -tlnp | grep :3000

This command shows what’s using port 3000. Either stop the conflicting service or change Rocket.Chat’s port in the .env file.

MongoDB Connection Issues

If Rocket.Chat can’t connect to MongoDB:

  1. Verify MongoDB is running: sudo systemctl status mongod
  2. Check authentication: Ensure the MongoDB user and password match your .env file
  3. Test connection manually: Use mongosh to verify you can connect with the same credentials

Permission Problems

File permission issues often cause startup failures:

sudo chown -R rocketchat:rocketchat /opt/Rocket.Chat
sudo chmod +x /opt/Rocket.Chat/main.js

These commands ensure the rocketchat user can access all necessary files.

Security Best Practices

Securing your Rocket.Chat installation is crucial for protecting your team’s communications.

Firewall Configuration

Configure your firewall to only allow necessary ports:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

This opens ports 80 and 443 while keeping other ports secure.

Regular Updates and Backups

  • Update Rocket.Chat regularly – New versions include security fixes and features
  • Backup your MongoDB database – Use mongodump to create regular backups
  • Monitor server logs – Watch for unusual activity or errors
  • Use strong passwords – Enforce password policies through admin settings

Consider setting up automated backups with a script that runs daily:

#!/bin/bash
mongodump --db rocketchat --out /backup/$(date +%Y%m%d)

Frequently Asked Questions

1. Can I install Rocket.Chat on older versions of Fedora?

While this guide focuses on Fedora 35+, you can install Rocket.Chat on older versions with some modifications. The main differences involve package names and repository configurations. However, for security and performance reasons, I recommend using a supported Fedora version.

2. How much RAM does Rocket.Chat actually need in production?

For small teams (under 50 users), 2GB RAM is sufficient. Medium teams (50-200 users) should have 4-8GB RAM. Large deployments require 8GB+ and benefit from dedicated servers. Monitor your system’s memory usage and scale accordingly.

3. Can I migrate from another chat platform to Rocket.Chat?

Yes! Rocket.Chat supports importing data from Slack, HipChat, and other platforms. The process involves exporting data from your current platform and using Rocket.Chat’s import tools. Plan the migration during low-usage periods and test thoroughly.

4. Is it possible to enable video calling in my Rocket.Chat installation?

Absolutely! Rocket.Chat supports video calling through Jitsi Meet integration or WebRTC. You can configure this through the admin panel under “Video Conference.” For better performance, consider setting up your own Jitsi Meet server.

5. How do I backup and restore my Rocket.Chat data?

Back up your MongoDB database using mongodump and restore with mongorestore. Also backup your uploaded files (usually in /opt/Rocket.Chat/uploads). For automated backups, create a script that runs daily and stores backups in a secure location. Test your restore procedure regularly to ensure data integrity.

Marshall Anthony is a professional Linux DevOps writer with a passion for technology and innovation. With over 8 years of experience in the industry, he has become a go-to expert for anyone looking to learn more about Linux.

Related Posts