Published June 06, 2019 by

Install Rocket.Chat on Ubuntu or Debian

Rocket Chat is the leading open source team chat software solution. Free, unlimited and completely customizable with on-premises and SaaS cloud hosting.

You can consider rocket chat as an alternative to Skype and Slack chat solutions.


In this tutorial, we are learning how to install rocket chat on Ubuntu or Debian and configure let's encrypt SSL also we discuss how to take backup Rocket chat server.

Install Rocket chat Server

1. Update the system.
 sudo apt-get update  

2. Install snap if it is not installed.
 sudo apt-get install snapd  

3. Install Rocket Chat
 sudo snap install rocketchat-server  

4. Check if Rocket Chat is running
 sudo service snap.rocketchat-server.rocketchat-server status  

Then browse to http://localhost:3000 and setup Rocket Chat Server. 


Setup NGINX with Reverse Proxy and SSL

5. Install Nginx and enabled to start automatically on reboot
 sudo apt install nginx  
 sudo systemctl start nginx  
 sudo systemctl enable nginx  
6. Set up NGINX Reverse Proxy

Remove the default site
 sudo rm /etc/nginx/sites-enabled/default  

Create /etc/nginx/sites-available/rocketchat.conf file.
 vim /etc/nginx/sites-available/rocketchat.conf  

add the necessary values to point to your domain name and to add the reverse proxy. Replace example.com with your actual domain name.
 server {  
   listen 80;  
   
   server_name example.com;  
   
   location / {  
     proxy_pass http://localhost:3000/;  
   }  
 }  

Enable the new configuration by creating a link to it from /etc/nginx/sites-available/
 sudo ln -s /etc/nginx/sites-available/rocketchat.conf /etc/nginx/sites-enabled/  

Test the configuration and reload the new configuration
 sudo nginx -t  
 sudo nginx -s reload  

7. Generate SSL certificates using Certbot
 sudo apt-get install python-certbot-nginx  
 sudo certbot --nginx  

Certbot will ask for information about the site. The responses will be saved as part of the certificate also Certbot will also ask if you would like to automatically redirect HTTP traffic to HTTPS traffic. It is recommended that you select this option.

Again Test the configuration and reload the new configuration
 sudo nginx -t  
 sudo nginx -s reload  

Then browse to https://yourdomain.com and setup Rocket Chat Server.