frame

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

Rocket.Chat installation in CentOS 7

ValentineValentine Member
edited September 25 in Web Applications

Rocket.Chat is a Web Chat Server, developed in JavaScript, using the Meteor fullstack framework as a Slack alternative

It is a great solution for communities and companies wanting to privately host their own chat service or for developers looking forward to building and evolve their own chat platforms.

The tutorial was prepared with our "CentOS 7" template and is meant to work on our self-managed virtual private servers.

WARNING

CentOS 7 reached the EOL June 30, 2024:

https://blog.centos.org/2023/04/end-dates-are-coming-for-centos-stream-8-and-centos-linux-7/

Because of this, you may encounter some repository issues. We recommend that you reinstall another OS that has not yet reached EOL.

If you are using CentOS 7 and encounter a mirror issue, please check out this guide to resolve the problem.

0. Preliminary requirements:
"CentOS 7" template installed on the server;
Removed Apache (yum remove httpd -y).

1. Installation of dependencies

The first thing we need to do is to install epel repository. For this enter command:

yum install epel-release nano -y && yum update -y

Now we need to add MongoDB repository. Create new file "mongodb.repo" and paste repository info in it:

nano /etc/yum.repos.d/mongodb-org-4.00.re
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
We are now ready to install all the necessary dependencies:
yum install -y nodejs curl GraphicsMagick npm mongodb-org-server mongodb-org gcc-c++

npm install -g inherits n

n 4.8.4

2. Rocket.Chat installation

The following commands will download and install the latest Rocket.Chat instance:

cd /opt

curl -L https://releases.rocket.chat/stable -o rocket.chat.tar

tar zxvf rocket.chat.tgz

mv bundle Rocket.Chat

cd Rocket.Chat/programs/server

npm install

3. Creating auto start

We don't want for server restart to intervene with our Rocket.Chat accessibility. For that we have to enable Rocket.Chat auto start. Just create service file:

nano /usr/lib/systemd/system/rocketchat.service

With a text:
[Unit]
Description=The Rocket.Chat server
After=network.target remote-fs.target nss-lookup.target nginx.target mongod.target
[Service]
ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=root
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat ROOT_URL=http://server-hostname/ PORT=80
[Install]
WantedBy=multi-user.target
NOTE: do not forget to change server-hostname with your server hostname.

And enable this service by running:

systemctl enable rocketchat.service

4. Launching Rocket.Chat

We are finally ready to launch our Rocket:

systemctl start rocketchat.service

Open http://server-hostname with your favorite browser and register a new account:


For Rocket.Chat user guides please visit - https://rocket.chat/docs/user-guides/




Comments

  • I did all steps and the Rocketchat service is active (running). I also changed the hostname but on my domain I only see the Apache test website. Any ideas?
  • badboxer said:
    I did all steps and the Rocketchat service is active (running). I also changed the hostname but on my domain I only see the Apache test website. Any ideas?
    Make sure you have removed Apache (step 0). Also in step 3 server-hostname should be the domain you are going to use.
  • badboxerbadboxer Member
    edited March 2017
    Valentine said:
    badboxer said:
    I did all steps and the Rocketchat service is active (running). I also changed the hostname but on my domain I only see the Apache test website. Any ideas?
    Make sure you have removed Apache (step 0). Also in step 3 server-hostname should be the domain you are going to use.
    Yes, I overlooked step 0.

    Thank you for your very fast response!
  • Hey Valentine.

    Can you explain how to add TLS (using Certbot / Let's Encrypt) for this tutorial?
Sign In or Register to comment.

Time4VPS

Learn how to install a web and database server, email, FTP client or other applications. Discover and share information on server security or optimization recommendations.
Feel free to join our constantly expanding community, participate in discussions, strengthen your knowledge on Linux and Windows server management!
© 2013 - 2024 Time4VPS. All rights reserved.

Get In Touch