How To Install Rocketchat On Centos7.8

Installation Of Rocketchat On Centos7.8

Rocket Chat is an open source communication hub. It is used by different kinds of such as banks, and government agencies for setting up their own chat tool. Users can customize Rocket.Chat, choose their users, and securely manage data. It cab be set up both on cloud and also with own servers on-premises. This Tutorial covers the installation of Rocket.Chat on CentOS 7.8

Installation process.

Before you begin, check the CentOS version by using the following command

[root@linuxhelp ~]# rpm -q centos-release
centos-release-7-8.2003.0.el7.centos.x86_64

Run the following command to paste the mongodb repo on the following location

[root@linuxhelp ~]# cat << EOF | sudo tee -a /etc/yum.repos.d/mongodb-org-4.0.repo
> [mongodb-org-4.0]
> name=MongoDB Repository
> baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/
> gpgcheck=1
> enabled=1
> gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
> EOF
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

Now add the nodejs version 12 repo by using the following command

[root@linuxhelp ~]# curl -sL https://rpm.nodesource.com/setup_12.x | sudo bash -

## Installing the NodeSource Node.js 12.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m

.
.
.
## Run `sudo yum install -y nodejs` to install Node.js 12.x and npm.
## You may also need development tools to build native addons:
     sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
     sudo yum install yarn

Install the epel-release by using the following command

[root@linuxhelp ~]# yum install -y epel-release
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
mongodb-org-4.0                                                          | 2.5 kB  00:00:00     
nodesource                                                               | 2.5 kB  00:00:00     
(1/2): mongodb-org-4.0/primary_db                                        |  83 kB  00:00:00     
.
.
Downloading packages:
epel-release-7-11.noarch.rpm                                             |  15 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : epel-release-7-11.noarch                                                     1/1 
  Verifying  : epel-release-7-11.noarch                                                     1/1 

Installed:
  epel-release.noarch 0:7-11                                                                    

Complete!

Install the requirements for Rocket.Chat by using the following command

[root@linuxhelp ~]# yum install -y gcc-c++ make mongodb-org nodejs 
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                     | 4.3 kB  00:00:00     
 * base: centos.excellmedia.net
 * epel: fedora.ipserverone.com
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
epel                                                                     | 4.7 kB  00:00:00     
(1/3): epel/x86_64/group_gz                                              |  95 kB  00:00:00     
(2/3): epel/x86_64/updateinfo                                            | 1.0 MB  00:00:04     
(3/3): epel/x86_64/primary_db                                            | 6.9 MB  00:00:17     
Package 1:make-3.82-24.el7.x86_64 already installed and latest version
.
.
.
Installed:
  gcc-c++.x86_64 0:4.8.5-39.el7                   mongodb-org.x86_64 0:4.0.19-1.el7            
  nodejs.x86_64 2:12.18.3-1nodesource            

Dependency Installed:
  cpp.x86_64 0:4.8.5-39.el7                        gcc.x86_64 0:4.8.5-39.el7                   
  glibc-devel.x86_64 0:2.17-307.el7.1              glibc-headers.x86_64 0:2.17-307.el7.1       
  kernel-headers.x86_64 0:3.10.0-1127.13.1.el7     libstdc++-devel.x86_64 0:4.8.5-39.el7       
  mongodb-org-mongos.x86_64 0:4.0.19-1.el7         mongodb-org-server.x86_64 0:4.0.19-1.el7    
  mongodb-org-shell.x86_64 0:4.0.19-1.el7          mongodb-org-tools.x86_64 0:4.0.19-1.el7     

Complete!

Install the graphicsmagick by using the following command

[root@linuxhelp ~]# yum install GraphicsMagick -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.excellmedia.net
 * epel: fedora.ipserverone.com
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
Resolving Dependencies
--> Running transaction check
---> Package GraphicsMagick.x86_64 0:1.3.34-1.el7 will be installed
.
.
  Installing : libwmf-lite-0.2.8.4-41.el7_1.x86_64                                          1/2 
  Installing : GraphicsMagick-1.3.34-1.el7.x86_64                                           2/2 
  Verifying  : GraphicsMagick-1.3.34-1.el7.x86_64                                           1/2 
  Verifying  : libwmf-lite-0.2.8.4-41.el7_1.x86_64                                          2/2 

Installed:
  GraphicsMagick.x86_64 0:1.3.34-1.el7                                                          

Dependency Installed:
  libwmf-lite.x86_64 0:0.2.8.4-41.el7_1                                                         

Complete!

Setup replication for monodb by using the following command

[root@linuxhelp ~]# sed -i "s/^#replication:/replication:\n  replSetName: rs01/" /etc/mongod.conf

Now start and enable the mongodb service

[root@linuxhelp ~]# systemctl start mongod
[root@linuxhelp ~]# systemctl enable mongod

Once it is done, check the replication by using the following command

[root@linuxhelp ~]# mongo --eval "printjson(rs.initiate())"
MongoDB shell version v4.0.19
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("6cc27489-498d-4f3c-9b1b-379fc0c5bd65") }
MongoDB server version: 4.0.19
{
	"info2" : "no configuration specified. Using a default configuration for the set",
	"me" : "127.0.0.1:27017",
	"ok" : 1,
	"operationTime" : Timestamp(1595479358, 1),
	"$clusterTime" : {
		"clusterTime" : Timestamp(1595479358, 1),
		"signature" : {
			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
			"keyId" : NumberLong(0)
		}
	}
}

And then, check the node version by using the following command

[root@linuxhelp ~]# node -v
v12.18.3

Run the npm inherits and node version required for rocketchat

[root@linuxhelp ~]# npm install -g inherits n && sudo n 12.18.3
/usr/bin/n -> /usr/lib/node_modules/n/bin/n
+ n@6.6.0
+ inherits@2.0.4
added 2 packages from 4 contributors in 0.395s

  installing : node-v12.18.3
       mkdir : /usr/local/n/versions/node/12.18.3
       fetch : https://nodejs.org/dist/v12.18.3/node-v12.18.3-linux-x64.tar.xz
   installed : v12.18.3 to /usr/local/bin/node
      active : v12.18.3 at /bin/node

Download the latest version of rocket chat

[root@linuxhelp ~]# curl -L https://releases.rocket.chat/latest/download -o /opt/rocket.chat.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   132  100   132    0     0     80      0  0:00:01  0:00:01 --:--:--    80
100  154M  100  154M    0     0  1092k      0  0:02:24  0:02:24 --:--:-- 1129k

Enter into the /opt directory

[root@linuxhelp ~]# cd /opt/

Extract the downloaded file by using the tar command

[root@linuxhelp opt]# tar -xvf rocket.chat.tgz 
bundle/
bundle/programs/
bundle/programs/web.browser.legacy/
bundle/programs/web.browser.legacy/head.html
bundle/programs/web.browser.legacy/program.json
bundle/programs/web.browser.legacy/dynamic/
bundle/programs/web.browser.legacy/dynamic/node_modules/
bundle/programs/web.browser.legacy/dynamic/node_modules/raf/
bundle/programs/web.browser.legacy/dynamic/node_modules/raf/package.json
.
.
.
bundle/programs/web.browser/packages/emojione/travel-sprites.png
bundle/programs/web.browser/325e89158f684bf2880b7902f410ef266f2cddb9.stats.json
bundle/programs/web.browser/86c67b6a478fff5f5001d6fefedcc7771fad7cab.css
bundle/main.js
bundle/server/
bundle/server/.bundle_version.txt
bundle/.node_version.txt
bundle/star.json
bundle/README

Rename the bundle to rocketchat

[root@linuxhelp opt]# mv bundle rocketchat

Enter into the following location and run npm install

[root@linuxhelp opt]# cd rocketchat/programs/server/
[root@linuxhelp server]# npm install
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

> fibers@4.0.3 install /opt/rocketchat/programs/server/node_modules/fibers
> node build.js || nodejs build.js

`linux-x64-72-glibc` exists; testing
Problem with the binary; manual build incoming
make: Entering directory `/opt/rocketchat/programs/server/node_modules/fibers/build'
  CXX(target) Release/obj.target/fibers/src/fibers.o
  CXX(target) Release/obj.target/fibers/src/coroutine.o
  CC(target) Release/obj.target/fibers/src/libcoro/coro.o
  SOLINK_MODULE(target) Release/obj.target/fibers.node
  COPY Release/fibers.node
make: Leaving directory `/opt/rocketchat/programs/server/node_modules/fibers/build'
Installed in `/opt/rocketchat/programs/server/node_modules/fibers/bin/linux-x64-72-glibc/fibers.node`
npm WARN lifecycle meteor-dev-bundle@~install: cannot run in wd meteor-dev-bundle@ node npm-rebuild.js (wd=/opt/rocketchat/programs/server)
added 146 packages from 122 contributors and audited 147 packages in 13.074s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Come back to rocketchat directory

[root@linuxhelp server]# cd ../..

Export the root url by using the following command

[root@linuxhelp rocketchat]# export ROOT_URL=http://192.168.7.228:3000

Also, export the mongodb URL by using the following command

[root@linuxhelp rocketchat]# export MONGO_URL=mongodb://localhost:27017/rocketchat

And then, export the port number

[root@linuxhelp rocketchat]# export PORT=3000

Export the mongodb oplog URL by using the following command

[root@linuxhelp rocketchat]# exportMONGO_OPLOG_URL=mongodb://localhost:27017/local?replSet=rs01

Run the following command to start Rocket.Chat

[root@linuxhelp rocketchat]# node main.js
LocalStore: store created at 
LocalStore: store created at 
LocalStore: store created at 
Setting default file store to GridFS
ufs: temp directory created at "/tmp/ufs"
Loaded the Apps Framework and loaded a total of 0 Apps!
Updating process.env.MAIL_URL
Using GridFS for custom sounds storage
Using GridFS for custom emoji storage
Browserslist: caniuse-lite is outdated. Please run next command `npm update`
(node:57578) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
➔ System ➔ startup
➔ +--------------------------------------------------+
➔ |                  SERVER RUNNING                  |
➔ +--------------------------------------------------+
➔ |                                                  |
➔ |  Rocket.Chat Version: 3.4.2                      |
➔ |       NodeJS Version: 12.18.3 - x64              |
➔ |      MongoDB Version: 4.0.19                     |
➔ |       MongoDB Engine: wiredTiger                 |
➔ |             Platform: linux                      |
➔ |         Process Port: 3000                       |
➔ |             Site URL: http://192.168.7.228:3000  |
➔ |     ReplicaSet OpLog: Enabled                    |
➔ |          Commit Hash: e5f93d3f5e                 |
➔ |        Commit Branch: HEAD                       |
➔ |                                                  |
➔ +--------------------------------------------------+

Once all the above process is completed, go to the browser and enter the ip address and port number Configure the admin credentials And then select your organization information You can set up server info of Rocket.Chat Register the server The dashboard of Rocket.Chat

With this the installation of Rocket.Chat on CentOS 7.6 comes to end

FAQ
Q
The altrenatives to rocketchat?
A
Microsoft teams
slack
mattermost
cisco webex teams
etc
Q
Who uses rocket chat?
A
Today, Rocket. Chat is an open source team collaboration platform that enables banks, NGOs, startups, and governmental organizations to have their own chat tool, customize its look and feel, choose their users, and securely manage data.
Q
What is rocket chat written?
A
Rocket. Chat is a Web Chat Server, developed in JavaScript, using the Meteor full stack framework.
Q
Is Rocketchat free?
A
Free audio and video conferencing, guest access, screen sharing, file sharing, LiveChat, LDAP Group Sync, two-factor authentication (2FA), E2E encryption, SSO, and dozens of OAuth providers. Also includes unlimited: Users.
Q
What is rocketchat ?
A
Rocket. Chat is a Web Chat Server, developed in JavaScript, using the Meteor fullstack framework. It is a great solution for communities and companies wanting to privately host their own chat service or for developers looking forward to build and evolve their own chat platforms