Rocket.Chat does not support this deployment method. Using it may lead to unexpected challenges or compatibility issues. The recommended deployment methods are Docker and Kubernetes.
Snaps offer a quick and straightforward way to deploy a Rocket.Chat workspace, primarily suited for development purposes. We do not recommend using Snaps in a production environment.
Snaps are self-contained packages that bundle all necessary files and dependencies, simplifying the installation and update processes on Linux systems. By using Snaps, you can deploy Rocket.Chat on any Linux distribution in a secure environment, with the added benefit of automatic updates whenever a new version of Rocket.Chat is released.
Prerequisites
Before getting started, ensure you have:
A Linux-based system (e.g., Ubuntu, Debian, Fedora, etc.)
A CPU supporting AVX/AVX2 to run the required MongoDB version for the Rocket.Chat release.
Snap installed (It comes pre-installed on most modern Linux distributions. If not, refer to the Snaps installation guide)
Step 1: Deploy Rocket.Chat using Snaps
To install Rocket.Chat via Snap on your Linux system, run the following command:
sudo snap install rocketchat-server --channel=x.x/stableThis installs a specific version of Rocket.Chat. When using the --channel=x.x/stable flag, the first x represents the major version of the release, while the second x remains unchanged. For example, use 6.x/stable to install the latest release on version 6. Visit Snap Channels for more details.
The following command installs the latest available version of Rocket.Chat:
sudo snap install rocketchat-serverOnce the installation is complete, access your workspace by opening a web browser and navigating to the root URL (e.g., http://localhost:3000).
It is recommended that you specify the version that you want to deploy.
Once your workspace is deployed, the first user to log in using the setup wizard is set as the administrator. Next, to start using your workspace, check out the following documents:
User Guides: Learn the basics of your Rocket.Chat account, the types of rooms, and how to communicate with your workspace users.
Workspace Administration: Administrators and owners can set and manage various configurations.
Marketplace: Explore the available apps to enhance your workspace.
Step 2: Enable HTTPs
Starting from release 0.73, Snaps include Caddy, a web server that integrates with Let's Encrypt for automatic SSL/TLS encryption. Snap hooks simplify the configuration process by ensuring proper DNS setup before enabling Let's Encrypt.
Set up auto SSL with Snaps (4.x Latest for AMD64 or 3.x Latest for ARM64)
To enable SSL for your Rocket.Chat workspace using Snap, follow these steps:
Ensure that your domain resolves to the IP address of your server.
Set the
siteurlto your domain, prefixed with HTTPS:sudo snap set rocketchat-server siteurl=https://<your-domain>Start Caddy and restart Rocket.Chat services:
sudo systemctl enable --now snap.rocketchat-server.rocketchat-caddy sudo snap restart rocketchat-serverAccess your Rocket.Chat workspace by navigating to
https://<your-domain>.
Additional steps
For further configuration, check out the following steps you can take to customize your deployment:
Configure Rocket.Chat with Snaps
To view the available configuration options for your Rocket.Chat Snap installation, run:
sudo snap get rocketchat-serverThis command will display a list of configurable variables, such as:
Key Value
backup-on-refresh disable
ignore-errors false
mongo-oplog-url mongodb://localhost:27017/local
mongo-url mongodb://localhost:27017/parties
port 3000
siteurl http://localhost:3000To set or update any of these variables, use the following command:
snap set rocketchat-server <variable-name>=<value>Change other Rocket.Chat environment variables
Starting from release 0.73, you can override any Rocket.Chat environment variable using .env files in the $SNAP_COMMON directory (/var/snap/rocketchat-server/common/). You can create multiple .env files and each file can define multiple environment variables.
For example, to change SMTP host setting:
Navigate to the
$SNAP_COMMONdirectory:cd /var/snap/rocketchat-server/commonCreate a file named
overwrite-smtp.envand add the snippet below:OVERWRITE_SETTING_SMTP_Host=my.smtp.server.comRestart the Rocket.Chat service to apply the changes:
sudo systemctl restart snap.rocketchat-server.rocketchat-server.service
Similarly, to add certificates, create a .env in the /var/snap/rocketchat-server/common or the /var/snap/rocketchat-server/current directory. The file must contain simple key=value pairs. Once this is done, restart the Rocket.Chat service.
Configure MongoDB
Starting from track 4.x, you can configure MongoDB for your Rocket.Chat instance. The configuration file is located in /var/snap/rocketchat-server/current/mongod.conf. For all the configuration options, see MongoDB's official documentation.
Update Rocket.Chat on Snap
Snap tracks let you control which major version of Rocket.Chat you're running, ensuring that your workspace receives updates specific to that track. This means your server will continue to get the latest patches and minor updates for the current track without automatically upgrading to a new major release. For example, if your workspace is on the 5.x track, it will ignore updates for 6.x until you choose to switch tracks. This approach gives you flexibility, allowing you to adopt new major versions when you're ready while keeping your workspace up-to-date within your current track. By default, the Rocket.Chat Snap installation is set to the latest available track at the time of setup.
Before updating your workspace, consider the following:
Backup your data before performing an upgrade.
Review the Rocket.Chat forums for announcements regarding major updates. Often, major releases are delayed for feedback and minor patches before the final release.
Refer to the general guidelines for updating Rocket.Chat.
Update to the latest release on your current track
To update your workspace to the latest release within your current track, refresh your server by running:
sudo snap refresh rocketchat-serverUpdate to a new major release
To update to a new major version, switch to the desired track and refresh your Rocket.Chat server:
sudo snap switch rocketchat-server --channel=x.x/stable
sudo snap refresh rocketchat-serverAlternatively, to immediately update to the latest release of a specific major version, run:
sudo snap refresh rocketchat-server --channel=x.x/stableLearn more about track changes in this discussion. If you have any concerns or issues with your deployment, see Snaps FAQ.
Snap backup and restore
The Snap backup and restore feature allows you to easily create backups of your Rocket.Chat instance and restore them when needed. This ensures that your data is protected and can be recovered at any time.
Backup Rocket.Chat Snap data
To enable automatic backups whenever your Snap installation is refreshed, run:
sudo snap set rocketchat-server backup-on-refresh=enableTo manually create a backup of your Rocket.Chat Snap data, follow these steps:
Stop your
rocketchat-serverby running the command:sudo service snap.rocketchat-server.rocketchat-server stopWhile the
rocketchat-server serviceshould be stopped, therocketchat-mongoservice should be kept running. To verify this, run the following command:sudo service snap.rocketchat-server.rocketchat-mongo status | grep ActiveEnsure MongoDB is still running with the output:
Active: active (running)Run the backup command:
sudo snap run rocketchat-server.backupdbA successful backup will return this:
[+] A backup of your data can be found at /var/snap/rocketchat-server/common/backup/rocketchat_backup_<timestamp>.tar.gzStart your
rocketchat-serversudo service snap.rocketchat-server.rocketchat-server startCopy the backup to a secure location on another system for safekeeping.
Restore Rocket.Chat Snap data
To restore your Rocket.Chat Snap data, follow these steps:
Stop your
rocketchat-serverby running this command:sudo service snap.rocketchat-server.rocketchat-server stopWhile the
rocketchat-server serviceshould be stopped, therocketchat-mongoservice should be kept running. To verify this, run the following command:sudo service snap.rocketchat-server.rocketchat-mongo status | grep Active Active: active (running) (...)Copy your backup file to the snap's common folder:
sudo cp rocketchat_backup.tgz /var/snap/rocketchat-server/common/Run the restore command:
sudo snap run rocketchat-server.restoredb /var/snap/rocketchat-server/common/rocketchat_backup.tgzIf you are replacing an existing database, you get a warning message:
ATTENTION Your current database WILL BE DROPPED prior to the restore! Do you want to restore? 1) Yes 2) NoChoose your restore option. If it is successfully done, you will see an output similar to the following:
[*] Extracting backup file... [*] Restoring data... [*] Preparing database... [+] Restore completed! Please restart the snap.rocketchat services to verify.Start your
rocketchat-serversudo service snap.rocketchat-server.rocketchat-server start
Customizing Caddy or using an alternative HTTP proxy
You can either use Caddy with custom configurations or opt for a different HTTP proxy. The Snap package includes both Caddy v2 (preferred) and Caddy v1 (end-of-life), with v2 prioritized.
To configure Caddy manually, place your
Caddyfilein the following directory and restart the Rocket.Chat service:/var/snap/rocketchat-server/current/ sudo snap restart rocketchat-serverIf you prefer using another reverse proxy, disable Caddy by running:
sudo systemctl disable snap.rocketchat-server.rocketchat-caddy
Manual Caddy configuration for older Snap versions
If you're using an older Snap version or want more control over the HTTPS setup, you can manually configure Caddy as follows:
Run this command to disable automatic Caddy configuration:
sudo snap set rocketchat-server caddy=disableEdit the Caddyfile found at
/var/snap/rocketchat-server/current/Caddyfileand write your configuration.Replace
_caddy-url_and_port_with your site information. For example, suppose that you haveexample-domain.comdirected toward your server.If your DNS is not working, you could be instantly throttled by Let's Encrypt for up to a week.
Make sure your DNS is resolved before enabling TLS. To test your DNS you can use
http:http://example-domain.com reverse_proxy localhost:3000Restart Caddy:
sudo systemctl reload snap.rocketchat-server.rocketchat-caddyCheck the status to ensure Caddy started correctly:
sudo systemctl status snap.rocketchat-server.rocketchat-caddyOnce that is tested and resolved, to get secured communications, you can remove the
http://:example-domain.com reverse_proxy localhost:3000Using an IP address will not work for automatically enabling TLS with a publicly-trusted certificate. You must use a valid hostname for a trusted certificate. See the official guide for more information.
If you use an IP address, Caddy will still serve your site over TLS, but using a self-signed certificate.
Restart the Caddy service by running:
sudo systemctl reload snap.rocketchat-server.rocketchat-caddyYou can check that the Caddy service started correctly by running:
sudo systemctl status snap.rocketchat-server.rocketchat-caddy
If the configuration is successful, the website should now be accessible at https://example-domain.com.
Logging your Snaps deployment
For logging when deploying Rocket.Chat with Snaps, you can check logs using journalctl and snap logs. Here's how:
1. View Rocket.Chat logs
Since Snap services are managed by systemd, you can check logs using:
journalctl -u snap.rocketchat-server.rocketchat-server --no-pagerTo follow logs in real-time:
journalctl -u snap.rocketchat-server.rocketchat-server -fAlternatively, Snap provides a built-in command for viewing logs:
snap logs rocketchat-serverTo get real-time logs:
snap logs -f rocketchat-server2. View MongoDB logs
MongoDB logs are also managed by systemd. To check logs, run:
journalctl -u snap.rocketchat-server.rocketchat-mongo --no-pagerFor live logs, run:
journalctl -u snap.rocketchat-server.rocketchat-mongo -f3. View Caddy (HTTPS) logs
If you are using Caddy for SSL/TLS, check its logs with:
journalctl -u snap.rocketchat-server.rocketchat-caddy --no-pagerTo follow logs live:
journalctl -u snap.rocketchat-server.rocketchat-caddy -f4. Checking all Rocket.Chat Snap logs at once
Run the command below to view all logs related to Rocket.Chat (including Rocket.Chat itself, MongoDB, and Caddy):
journalctl -u snap.rocketchat-server.* --no-pagerTo follow logs live:
journalctl -u snap.rocketchat-server.* -fTroubleshooting
AppArmor errors after Snap update
If you encounter audit errors from MongoDB related to AppArmor being denied when checking logs, connect the following Snap interfaces:
sudo snap connect rocketchat-server:mount-observe
sudo snap connect rocketchat-server:network-observe
sudo snap connect rocketchat-server:system-observe
AppArmor will block access without these connections, resulting in repeated denial messages that could fill system logs and potentially consume significant disk space if log retention is not properly managed.