In this tutorial we will show you how to install Rocket.Chat on Ubuntu 16.04 LTS. For those of you who didn’t know, Rocket.Chat is one of the most popular open source chat software. A fantastic alternate to both Slack and compensated live chat software. It’s free, what is unlimited and it’s a bunch of cool features like Video chat, Screen sharing, Mobile apps and more.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Rocket.Chat on an Ubuntu 16.04 Xenial Xerus server.
Install Rocket.Chat on Ubuntu 16.04 LTS
Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.
Step 2. Installing MongoDB.
Rocket.Chat requires MongoDB for the installation. In this step, we will install MongoDB from the MongoDB repository:
apt-keyadv--keyserverhkp://keyserver.ubuntu.com:80 --recv EA312927
Then add the MongoDB repository with the command below:
echo"deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse"|sudotee/etc/apt/sources.list.d/mongodb-org-3.2.list
Update the repository and install MongoDB with the apt command:
Open MongoDB and set it to run automatically at boot time:
This is an optional step, but those who want performance improvements should follow it. Rocket.Chat Server uses a MongoDB replica set:
There, add this section:
Save, exit and restart MongoDB:
Next, run its shell and initiate the replica set:
After you run rs.initiate(), you should get the following results:
"info2":"no configuration specified. Using a default configuration for the set",
If the value of “ok” is not 1, then something’s wrong. Please go back and follow the steps exactly as shown in this tutorial.
Step 4. Installing Node.js and npm.
Node.js and npm are required by Rocket.Chat and are both available on Ubuntu repositories:
First, install the ‘n’ package globally on the whole system:
The messaging system requires Node.js 4.5+, so ensure that you choose 4.5:
Check if you have the right node.js version:
First, download the latest version of Rocket.Chat:
curl-Lhttps://rocket.chat/releases/latest/download -o rocket.chat.tgz
And extract it:
Rename the extracted folder:
Run the following commands to add some environment variables:
A Ubuntu 16.04 LEMP server is required. If you do not have LAMP installed, you can follow our guide here.
Create a new SSL directory, in which certificates will be stored:
In this directory, generate a new SSL certificate file:
There, paste the following configuration:
# Redirect Options
# enforce https
# HTTPS Server
ssl_protocolsTLSv1TLSv1.1TLSv1.2;# dont use SSLv3 ref: POODLE
Save, exit and activate this configuration:
And make sure there are no errors. If everything’s ok, restart Nginx:
Update the environment variables and run Rocket.Chat:
Rocket.Chat will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://chat.mydomain.com and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.
Congratulation’s! You have successfully installed Rocket.Chat with Docker. Thanks for using this tutorial for installing Rocket.Chat open source chat software on your Ubuntu 16.04. For additional help or useful information, we recommend you to check the official Rocket.Chat web site.