How To Install Rocket.Chat on Ubuntu 16.04 LTS

Install Rocket.Chat on Ubuntu 16.04 LTS

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:

Then add the MongoDB repository with the command below:

Update the repository and install MongoDB with the apt command:

Open MongoDB and set it to run automatically at boot time:

Step 3. Configure a MongoDB ReplicaSet.

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:

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:

Step 5. Installing Rocket.Chat.

First, download the latest version of Rocket.Chat:

And extract it:

Rename the extracted folder:

Run the following commands to add some environment variables:

Step 6. Install LEMP (Linux, Nginx, MariaDB and PHP) server.

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:

Next, create a Virtual Host configuration:

There, paste the following configuration:

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:

Step 7. Accessing Rocket.Chat.

Rocket.Chat will be available on HTTP port 80 by default. Open your favorite browser and navigate to 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.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!