Get Rewarded! We will reward you with up to €50 credit on your account for every tutorial that you write and we publish!

How to install Rocket.Chat on Ubuntu 20.04

profile picture
Author
Florian Voit
Published
2021-03-19
Time to read
4 minutes reading time

Introduction

Rocket.Chat is an open-source communication platform which allows users to chat with each other without sending the messages to external companies.

This tutorial shows how to install and configure a basic Rocket.Chat instance on Ubuntu 20.04 using snapd. There are also other possibilities to install Rocket.Chat. For that the official documentation should be consulted.

Prerequisites

  • Ubuntu 20.04 server with root privileges
  • Domain for accessing the instance (in this tutorial chat.example.com is used)

Step 1 - Configuring a firewall

First, a basic firewall should be set up so that only the desired ports are accessible from the Internet. In this case we're configuring the firewall using UFW. The firewall will be configured to allow traffic via port 80 (HTTP), 443 (HTTPS) and 22 (SSH - should be changed if you use an other port!).

ufw allow 22/tcp
ufw allow 80,443/tcp
ufw enable

Step 2 - Installing Rocket.Chat

Before we can start installing Rocket.Chat, we need to install snapd:

apt update
apt install snapd

Afterwards we can install Rocket.Chat using snap:

snap install rocketchat-server

ATTENTION If you don't use a firewall, the Rocket.Chat instance is now exposed publicly over port 3000.

Step 3 - Configuring SSL

The Rocket.Chat snap container already ships a reverse proxy (Caddy) which can obtain a SSL certificate via Let's Encrypt. It only needs to be configured with the domain for the chat system:

snap set rocketchat-server caddy-url=https://chat.example.com
snap set rocketchat-server caddy=enable
snap set rocketchat-server https=enable
snap run rocketchat-server.initcaddy

If no errors occurred, the Rocket.Chat and Caddy container can be restarted:

systemctl restart snap.rocketchat-server.rocketchat-server.service
systemctl restart snap.rocketchat-server.rocketchat-caddy.service

Now the Rocket.Chat instance is reachable through the configured domain and HTTP is redirected to HTTPS.

Step 4 - Configuring Rocket.Chat

Open the web browser and navigate to the domain we have set up above. Now Rocket.Chat should automatically open the setup wizard, where it asks for the credentials for the first user which automatically gets admin permissions.

Rocket.Chat Wizard - Step 1

Afterwards the setup wizard will ask for some organization info, you can enter these details or just skip the step by clicking on Continue.

In the 3rd step you can enter the name of the chat instance, set a default language and select if new users should automatically use Two Factor via e-mail.

Rocket.Chat Wizard - Step 3

In the last step, you can select whether the server should be registered in the Rocket.Chat Cloud or not. This is something you need to decide depending on your guidelines.

Step 5 - Exploring Rocket.Chat

Finally you can start using Rocket.Chat!

ATTENTION The registration form is enabled by default! This and much more can be changed in the admin area of your Rocket.Chat instance.

Rocket.Chat Overview

Conclusion

You now have a working basic Rocket.Chat installation. You can now start customizing your instance or just start chatting with your friends or colleagues.

Further information can be found in the Rocket.Chat Docs

License: MIT
Want to contribute?

Get Rewarded: Get up to €50 in credit! Be a part of the community and contribute. Do it for the money. Do it for the bragging rights. And do it to teach others!

Report Issue
Try Hetzner Cloud

Get €20/$20 free credit!

Valid until: 31 December 2024 Valid for: 3 months and only for new customers
Get started
Want to contribute?

Get Rewarded: Get up to €50 credit on your account for every tutorial you write and we publish!

Find out more