YouTube Icon

Code Playground.

How to deploy Rocket.Chat on CentOS 7


How to deploy Rocket.Chat on CentOS 7

Rocket.Chat is a finished group correspondence stage, a self-facilitated Slack other option. It is worked with Meteor and gives different highlights including helpdesk visit, video conferencing, document sharing, voice messages, API, and the sky is the limit from there. 

In this instructional exercise, we will tell you the best way to introduce and send Rocket.Chat on a CentOS 7 worker with Nginx as a SSL switch intermediary. 


Ensure that you have met the accompanying essentials prior to proceeding with this instructional exercise: 

CentOS 7 worker, as per the authority Rocket.Chat framework prerequisites you need in any event 1G of RAM. 

You are signed in as a client with sudo advantages . 

You have an area name highlighting your worker IP address. In this article, we will utilize 

You have Nginx introduced, if not you can introduce it by following this instructional exercise. 

A SSL authentication. You can produce a free one from Let's Encrypt , or get one from another supplier. 

Install Dependencies

Introduce the accompanying bundles which are important to fabricate the required npm modules: 

sudo yum install epel-release curl GraphicsMagick gcc-c++

Next, introduce Node.js and npm by composing: 

sudo yum install -y nodejs npm

At the hour of composing this article, the suggested Node.js adaptation for Rocket.Chat is Node.js v8.11.3. 

Issue the accompanying orders to introduce the n utility and the suggested Node.js rendition: 

sudo npm install -g inherits n
sudo n 8.11.3

MongoDB is a NoSQL report arranged information base and it is utilized by Rocket.Chat as an information store. Rocket.Chat suggests MongoDB rendition 3.6. 

We will introduce MongoDB utilizing yum from the authority MongoDB stores. 

Open your proofreader of decision and make the accompanying storehouse record: 

sudo nano /etc/yum.repos.d/mongodb-org.repo

Glue the accompanying substance into the record: 


name=MongoDB Repository

Save the record and close your content manager . 

To introduce MongoDB, run the accompanying order: 

sudo yum install mongodb-org

When the establishment is finished, empower and start the MongoDB administration: 

sudo systemctl start mongod
sudo systemctl enable mongod

Create New System User

Make another client and gathering, which will run our Rocket.Chat case. For straightforwardness we will name the client rocket: 

sudo useradd -m -U -r -d /opt/rocket rocket

Add the nginx client to the new client gathering and change the/select/rocket index authorizations with the goal that the Nginx can get to it: 

sudo usermod -a -G rocket nginx
sudo chmod 750 /opt/rocket

Installing Rocket.Chat

Change to the client rocket by composing: 

sudo su - rocket

Download the most recent stable variant of Rocket.Chat with twist : 

curl -L -o

Once the download is finished concentrate the document and rename the registry to Rocket.Chat: 

tar zxf
mv bundle Rocket.Chat

Change into the Rocket.Chat/programs/worker index and introduce all the required npm bundles: 

cd Rocket.Chat/programs/server
npm install

Prior to making systemd unit and setting up a converse intermediary with Nginx it is a smart thought to test if the establishment was fruitful. 

To do as such, start by setting the necessary climate factors: 

export PORT=3000
export ROOT_URL=
export MONGO_URL=mongodb://localhost:27017/rocketchat

Next, change once more into the Rocket.Chat index and start the Rocket.Chat worker by giving the accompanying orders: 

cd ../../
node main.js

On the off chance that there are no mistakes you should see the accompanying yield: 

? +---------------------------------------------+
? |                SERVER RUNNING               |
? +---------------------------------------------+
? |                                             |
? |  Rocket.Chat Version: 0.71.1                |
? |       NodeJS Version: 8.11.3 - x64          |
? |             Platform: linux                 |
? |         Process Port: 3000                  |
? |             Site URL:  |
? |     ReplicaSet OpLog: Disabled              |
? |          Commit Hash: e73dc78ffd            |
? |        Commit Branch: HEAD                  |
? |                                             |
? +---------------------------------------------+

Now, Rocket.Chat is introduced on your CentOS 7 machine. Stop the Rocket.Chat worker with CTRL+C and proceed with the following stages. 

Create a Systemd Unit

To run Rocket.Chat as a help make a rocketchat.service unit record in the/and so forth/systemd/framework/catalog: 

sudo nano /etc/systemd/system/rocketchat.service

Glue the accompanying substance into the record: 


Description=Rocket.Chat server

Environment=MONGO_URL=mongodb://localhost:27017/rocketchat ROOT_URL= PORT=3000
ExecStart=/usr/local/bin/node /opt/rocket/Rocket.Chat/main.js


Save and close the record. 

Inform systemd that another unit record was made and start the Rocket.Chat administration by executing: 

sudo systemctl daemon-reload
sudo systemctl start rocketchat

Check the administration status with the accompanying order: 

sudo systemctl status rocketchat

The yield should look something like this: 

 rocketchat.service - Rocket.Chat server
   Loaded: loaded (/etc/systemd/system/rocketchat.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-04-10 20:30:56 UTC; 8s ago
 Main PID: 32356 (node)
   CGroup: /system.slice/rocketchat.service
           ??32356 /usr/local/bin/node /opt/rocket/Rocket.Chat/main.js

In the event that there are no mistakes you can empower the Rocket.Chat administration to be naturally begun at boot time: 

sudo systemctl enable rocketchat

Set up a reverse proxy with Nginx

On the off chance that you followed our how to introduce Nginx on CentOS 7 and how to protect Nginx with Let's Encrypt on CentOS 7 aides you should as of now have Nginx introduced and arranged with SSL testament. 

Presently we need to make another worker block for our Rocket.Chat establishment: 

sudo nano /etc/nginx/conf.d/

Glue the accompanying substance into the document: 


upstream rocketchat_backend {

server {
    listen 80;

    include snippets/letsencrypt.conf;
    return 301$request_uri;

server {
    listen 443 ssl http2;

    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;
    ssl_trusted_certificate /etc/letsencrypt/live/;
    include snippets/ssl.conf;

    return 301$request_uri;

server {
    listen 443 ssl http2;

    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;
    ssl_trusted_certificate /etc/letsencrypt/live/;
    include snippets/ssl.conf;
    include snippets/letsencrypt.conf;

    access_log /var/log/nginx/;
    error_log /var/log/nginx/;

    location / {
        proxy_pass http://rocketchat_backend/;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $http_host;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forward-Proto http;
        proxy_set_header X-Nginx-Proxy true;

        proxy_redirect off;

Reload the Nginx administration for changes to produce results: 

sudo systemctl reload nginx
Configuring Rocket.Chat

Open your program and type: 

Expecting to be that establishment is effective, you'll be given the Rocket.Chat Setup Wizard which will control you through setting up your first administrator client, designing your association and enlisting your worker to get free pop-up messages and then some. 

The primary segment of the Initial Setup wizard will request that you set up your Admin client: 

Whenever you are finished entering the Admin information click on the Continue button and in the subsequent stage enter your association data: 

The third part of the Initial Setup wizard will provoke you to enter the worker data: 

In the subsequent stage you will be found out if you need to utilize the Rocket.Chat's preconfigured passages and intermediaries. Choosing this alternative will give you admittance to the Rocket.Chat Apps commercial center and the vast majority of different highlights, for example, message pop-ups will simply work out of the case. 

Settle on your decision, click on the Continue catch, and you will be diverted to the accompanying page showing that your workspace is prepared to utilize: 

Snap in a hurry to your workspace catch and you will be diverted to the Rocket.Chat dashboard signed in as the administrator client. 


You have effectively introduced Rocket.Chat on your CentOS 7 worker. You would now be able to begin utilizing Rocket.Chat to work together with your group, share records and visit continuously. 

On the off chance that you are confronting any issue with the establishment, don't hesitate to leave a remark.