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 24.04 using snapd. There are also other possibilities to install Rocket.Chat. For that the official documentation should be consulted.
Prerequisites
- Ubuntu 24.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!).
sudo ufw allow 22/tcp
sudo ufw allow 80,443/tcp
sudo ufw enable
Step 2 - Installing Rocket.Chat
Before we can start installing Rocket.Chat, we need to install snapd:
sudo apt update
sudo apt install snapd
Afterwards we can install Rocket.Chat using snap:
sudo 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:
sudo snap set rocketchat-server caddy=enable
sudo snap set rocketchat-server https=enable
sudo snap set rocketchat-server siteurl=https://<chat.example.com>
If no errors occurred, the Rocket.Chat and Caddy container can be restarted:
sudo systemctl restart snap.rocketchat-server.rocketchat-server.service
sudo 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.
Afterwards the setup wizard will ask for some organization info. Enter these details and then click on Continue
.
In the last step, you are asked for an email address to register the server in the Rocket.Chat Cloud. This is something you need to decide depending on your guidelines.
Afterwards, check your emails to verify the registration.
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.
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