Installing Rocket.Chat on Ubuntu 16.04
Traducciones al EspañolEstamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
DeprecatedThis guide has been deprecated and is no longer being maintained.
Rocket.Chat is an open source chat software alternative to Slack that ships with the feature rich components users have come to expect for team productivity. Chat with team members, make video and audio calls with screen sharing, create channels and private groups, upload files and more. With Rocket.Chat’s source code hosted on GitHub, you can develop new features and contribute back to the project.
This guide provides the steps to deploy Rocket.Chat on a Linode running Ubuntu 16.04 LTS, using NGINX as a reverse proxy with SSL.
Before You Begin
If you have not already done so, create a Linode account and Compute Instance. See our Getting Started with Linode and Creating a Compute Instance guides.
Follow our Setting Up and Securing a Compute Instance guide to update your system. You may also wish to set the timezone, configure your hostname, create a limited user account, and harden SSH access.
Complete the Add DNS Records steps to register a domain name that will point to your Rocket.Chat server instance.
Install Rocket.Chat
The quickest way to install Rocket.Chat is to use its Snap. Snaps are containerized software packages that run on all major Linux systems. Snapd is the service that runs and manages snaps. Snapd is installed by default on Ubuntu 16.04 LTS.
Install Rocket.Chat
sudo snap install rocketchat-server
Once installed, the Rocket.Chat service starts automatically. To check if Rocket.Chat is running:
sudo service snap.rocketchat-server.rocketchat-server status
Visit the Rocket.Chat snaps documentation to view a list of other useful commands.
Install and Configure NGINX to use Reverse Proxy and SSL
A reverse proxy is a server that sits between internal applications and external clients, forwarding client requests to the appropriate server. While many common applications are able to function as servers on their own, NGINX has a number of advanced load balancing, security, and acceleration features that most specialized applications lack. Using NGINX as a reverse proxy enables you to add these features to any application. We will use NGINX as a reverse proxy for Rocket.Chat.
Install NGINX
Download NGINX from the package manager:
sudo apt install nginx
Ensure NGINX is running and enabled to start automatically on reboot:
sudo systemctl start nginx sudo systemctl enable nginx
Set up NGINX Reverse Proxy
Disable the default Welcome to NGINX page. The default page is configured within
/etc/nginx/sites-enabled/default
. This is actually a link to a file within/etc/nginx/sites-available/
:sudo ls -l /etc/nginx/sites-enabled
total 0 lrwxrwxrwx 1 root root 34 Aug 16 14:59 default -> /etc/nginx/sites-available/default
Remove this link to disable the default site:
sudo rm /etc/nginx/sites-enabled/default
Create
/etc/nginx/sites-available/rocketchat.conf
and add the necessary values to point to your domain name and to add the reverse proxy. Replaceexample.com
with your domain name:- File: /etc/nginx/conf.d/rocketchat.conf
1 2 3 4 5 6 7 8 9
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:
sudo nginx -t
If no errors are reported, reload the new configuration:
sudo nginx -s reload
Generate SSL certificates using Certbot
Your Rocket.Chat site will use an SSL certificate from Let’s Encrypt, which is a free certificate provider trusted by common web browsers. A popular tool called Certbot makes getting and using a Let’s Encrypt certificate easy:
Install the Certbot and web server-specific packages, then run Certbot:
sudo apt update sudo apt install certbot python3-certbot-nginx sudo certbot --nginx
Certbot will ask for information about the site. The responses will be saved as part of the certificate:
# sudo certbot --nginx Saving debug log to /var/log/letsencrypt/letsencrypt.log Plugins selected: Authenticator nginx, Installer nginx Which names would you like to activate HTTPS for? ------------------------------------------------------------------------------- 1: example.com 2: www.example.com ------------------------------------------------------------------------------- Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel):
Certbot will also ask if you would like to automatically redirect HTTP traffic to HTTPS traffic. It is recommended that you select this option.
When the tool completes, Certbot will store all generated keys and issued certificates in the
/etc/letsencrypt/live/$domain
directory, where$domain
is the name of the domain entered during the Certbot certificate generation step.Note Certbot recommends pointing your web server configuration to the default certificates directory or creating symlinks. Keys and certificates should not be moved to a different directory.Finally, Certbot will update your web server configuration so that it uses the new certificate, and also redirects HTTP traffic to HTTPS if you chose that option.
If you have a firewall configured on your Linode, you can add a firewall rule to allow incoming and outgoing connections to the HTTPS service. On Ubuntu, UFW is a commonly used and simple tool for managing firewall rules. Install and configure UFW for HTTP and HTTPS traffic:
sudo apt install ufw sudo systemctl start ufw && sudo systemctl enable ufw sudo ufw allow http sudo ufw allow https sudo ufw enable
View Your Rocket.Chat Site
Certbot updated your NGINX configuration. Test the new configuration to make sure it works:
sudo nginx -t
If no errors are reported, reload the new configuration:
sudo nginx -s reload
In a browser, navigate to your domain address. Follow the Rocket.Chat setup wizard steps.
More Information
You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.
This page was originally published on