How to Install Rocket.Chat on CentOS

Install Rocket.Chat on CentOS - On-Premise Team Communications

Rocket.Chat is an open-source, online communications platform you can self-host on Linux servers. We won’t compare Slack versus Rocket.Chat in-depth here. However, when you install Rocket.Chat, you gain an open-source platform where you have complete control over system availability and your team’s data.

We’ll also cover installing Rocket.Chat dependencies – MongoDB, NodeJS, and GraphicsMagick.

Install Rocket.Chat

  1. First, log into SSH as root.
  2. Update your package list:
    sudo yum -y check-update
  3. Create a MongoDB YUM repo file with your preferred text editor (we’ll use Nano):
    nano /etc/yum.repos.d/mongodb-org-4.0.repo
  4. Add the following data, then save the file:
    [mongodb-org-4.0]name=MongoDB Repository

  5. Download the Node.JS installation script:
    sudo yum install -y curl && curl -sL | sudo bash -
  6. Install build tools, MongoDB, and Node.JS:
    sudo yum install -y gcc-c++ make mongodb-org nodejs
  7. Install the Extra Packages for Enterprise Linux (EPEL) repository and GraphicsMagick:
    sudo yum install -y epel-release && sudo yum install -y GraphicsMagick
  8. Install Inherits and the required Node version:
    sudo npm install -g inherits n && sudo n 12.18.4
  9. Download the latest Rocket.Chat application to your /tmp directory:
    curl -L -o /tmp/
  10. Extract the tar file:
    tar -xzf /tmp/ -C /tmp
  11. Navigate to the extracted /server subdirectory:
    cd /tmp/bundle/programs/server
  12. Install the dependencies in the /server directory:
    npm install
  13. Move the Rocket.Chat /bundle directory into /opt:
    sudo mv /tmp/bundle /opt/Rocket.Chat

    You can choose another directory in lieu of /opt. If you choose to do so, remember to replace /opt with your preferred directory in steps 15 and 17.

  14. Create a rocketchat system user (with no home directory) and disable password access with the user:
    sudo useradd -M rocketchat && sudo usermod -L rocketchat
  15. Set the rocketchat user as the owner of the Rocket.Chat directory:
    sudo chown -R rocketchat:rocketchat /opt/Rocket.Chat
  16. Create a Rocket.Chat service file:
    nano /lib/systemd/system/rocketchat.service
  17. Add the following data:
    [Unit]Description=The Rocket.Chat server
    [Service]ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js
    Environment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01 ROOT_URL=http://localhost:3000/ PORT=3000
  18. Change the “ROOT_URL” to “” You can change the “MONGO_URL,” “MONGO_OPLOG_URL,” and “PORT” if desired.
  19. Save changes.
  20. Ensure port 3000 (or other port if changed) is open in your firewall.
  21. Set MongoDB to use the MMAPv1 Storage Engine:
    sudo sed -i "s/^#  engine:/  engine: mmapv1/"  /etc/mongod.conf
  22. Set MongoDB to use the rs01 shard:
    sudo sed -i "s/^#replication:/replication:\n  replSetName: rs01/" /etc/mongod.conf
  23. Set MongoDB to run after system restarts and now:
    sudo systemctl enable mongod && sudo systemctl start mongod
  24. Initiate a replica set:
    mongo --eval "printjson(rs.initiate())"
  25. Set Rocket.Chat to run after system restarts and now:
    sudo systemctl enable rocketchat && sudo systemctl start rocketchat

Rocket.Chat Setup Wizard

  1. Access your new installation in a web browser (
  2. Specify a name, username, email address, and password. Select “Continue.”
    Rocket.Chat admin info page
  3. Specify your organization info – type, name, industry, size, country, and website.
    Rocket.Chat Organization Info page
  4. On the next page, set the site name, language, server type (private or public), and two-factor authentication settings. Select “Continue.”
    Rocket.Chat Server Info page
  5. “Register to access” is preselected so you can receive updates. You can further set this up later. Agree with the terms and select “Continue.”
    Rocket.Chat Register Server page
  6. Select “Go to your workspace.”
    Rocket.Chat workspace ready to use
  7. Specify a Rocket.Chat username on the “Register Username” page. Select “Use this username.”
    Register username in Rocket.Chat

    You’ll then be logged into Rocket.Chat.

Note that Rocket.Chat plays alert sounds with some text notifications.

Rocket.Chat first login screenshot

Getting Started with Rocket.Chat

Select the username button in the upper-left corner to:

  • Set user status from online, away, and others
  • Access administration settings
  • Access Omnichannel for live chat communication integrations including email, WhatsApp, and WeChat
  • Configure user settings
  • Log out
Rocket.Chat user menu options

The buttons beside the user icon allow you to:

  • Return to the homepage
  • Search users
  • Search your directory for other channels created
  • Customize your user interface display
  • Create a new channel, team, direct message, or discussion

You start with the #general channel. Select the channel on the left to access the chatroom and following options on the top:

  • Favorite (star) the channel
  • Detailed room information
  • Search threads
  • Search discussions
  • Search and invite members
  • Search messages
  • List uploaded files
  • And more…
Rocket.Chat channel navigation options

Next Steps

Shortly after you install Rocket.Chat, there are certain tasks you’ll want to finish sooner than later. Access administration settings from the user menu for common settings including:

  • Creating users
  • Configuring email for password resets, two-factor authentication (TFA) and notifications
  • Installing Rocket.Chat apps for additional features and security
  • Integrate video conferencing with Jitsi or BigBlueButton

You should configure SMTP immediately for cases where a user can’t log into Rocket.Chat (Administration > Email > SMTP).

Here’s the login prompt you’ll see to log into Rocket.Chat.

Rocket.Chat login page
With our Cloud VPS plans, you can deploy a lightning-fast, reliable cloud platform with built-in redundancy – ensuring the availability of your environment!
Jacqueem Content Writer I

Technical writer focused on cybersecurity and musicianship.

More Articles by Jacqueem


It looks like this article doesn't have any comments yet - you can be the first. If you have any comments or questions, start the conversation!

Was this article helpful? Let us know!