Rocket.Chat: How To Install The Messaging System on Debian 9


Rocket.Chat on Debian 9

What’s Rocket.Chat

Rocket.Chat is a professional, Slack-like messaging system, developed for companies wanting to privately host their own chat service. It is developed in JavaScript using the Meteor full stack framework.

It has many features, like:

    • Help desk chat
    • Video conferences
    • File sharing
    • Link previews
    • Voice messages

We will install Rocket.Chat on a Debian 9 server.

Getting Started

The first thing to do is to satisfy Rocket.Chat dependencies. Execute the following apt command:

Install MongoDB

Rocket.Chat works with MongoDB as database system. There aren’t already Debian 9 packages for MongoDB, so we will install it from the tarball.

Download the tarball

First, download with curl the MongoDB tarball

Extract the archive

Extract the previously downloaded archive by executing the following command:

Rename and move the directory, for example, in /opt:

Update the PATH variable by adding the /opt/mongodb/bin directory. In ~/.bashrc add the following line:

Create a unit file

Create a systemctl unit file for MongoDB, executing the following command:

In this file, paste the following content:

Save and exit.

Reload systemd daemon service:

Start MongoDB

At this point, we can start MongoDB and enable it for starting at boot time:

Install Node.js and npm

Rocket.Chat requires Node.js (in particular, any version newer than 4.5) and npm. First of all, add the NodeSource repository:

Next, execute the following command for installing both Node.js and npm:

Check the Node.js version:

Next, install n through npm:

With n, it’s possible to change Node.js version.

Install Rocket.Chat

If not exists, create the /var/www directory, which will store Rocket.Chat:

In that directory, execute the following command for downloading Rocket.Chat:

Extract the archive and rename the extracted folder:

Next, set environment variables and run the Rocket.Chat server:

Those who are using the replica set should set the MONGO_URL variable with this content: mongodb://localhost:27017/rocketchat?replicaSet=001-rs

Rocket.Chat is installed and configured, but it requires configuration behind a web server. In this tutorial we’ll be using NGINX.

Install NGINX

NGINX can be install with apt:

Create a new directory that will contain the SSL certificates:

In this directory, generate a new key:

Change permissions to the key file:

Create a Virtual Host file:

In this file, paste the following content:

Save and close the file. Activate the configuration with:


If no errors occur, restart the web server:

Next, update the environment variables:

Run Rocket.Chat:

The final step is to insert the following URL into a web browser: to register a new admin account and finish the graphical configuration.


There you have it! We’ve just explained how to install and configure your Rocket.Chat Server on a Debian 9 server using NGINX. This useful online communication program can help your team work more efficiently and with more collaboration!


Facebook Comments

Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button