- Print
- DarkLight
- PDF
Deploy with Snaps
- Print
- DarkLight
- PDF
As of December 15, 2023, Rocket.Chat has ceased support for connections from cloud services and official mobile/desktop apps to workspaces running legacy versions outside our support window. Users on unsupported legacy servers are advised to upgrade to the latest Rocket.Chat version to ensure continued access to cloud, mobile, and desktop applications. Each Rocket.Chat version is supported for six months post-release.
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.
In this guide, you'll learn how to:
Prerequisites
Before getting started, ensure you have:
A Linux-based system (e.g., Ubuntu, Debian, Fedora, etc.)
A CPU supporting AVX/AVX2 to run MongoDB 5.0 (required for Rocket.Chat workspaces on version 6.0 and above)
Snap installed (It comes pre-installed on most modern Linux distributions. If not, refer to the Snaps installation guide)
Deploy Rocket.Chat using Snaps
To install Rocket.Chat via Snap on your Linux system, run the following command:
sudo snap install rocketchat-server
This installs the latest available version of Rocket.Chat. Once the installation is complete, access your workspace by opening a web browser and navigating to the root URL (e.g., http://localhost:3000
).
If you need to install a specific version, you can do so by specifying the track with the install command:
sudo snap install rocketchat-server --channel=x.x/stable
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.
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.
Setting 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
siteurl
to 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-server
Access your Rocket.Chat workspace by navigating to
https://<your-domain>
.
Configure Rocket.Chat with Snaps
To view the available configuration options for your Rocket.Chat Snap installation, run:
sudo snap get rocketchat-server
This 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:3000
To set or update any of these variables, use the following command:
snap set rocketchat-server <variable-name>=<value>
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.
Updating 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-server
Updating 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-server
Alternatively, to immediately update to the latest release of a specific major version, run:
sudo snap refresh rocketchat-server --channel=x.x/stable
Learn 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=enable
To manually create a backup of your Rocket.Chat Snap data, follow these steps:
Stop your
rocketchat-server
by running the command:sudo service snap.rocketchat-server.rocketchat-server stop
While the
rocketchat-server service
should be stopped, therocketchat-mongo
service should be kept running. To verify this, run the following command:sudo service snap.rocketchat-server.rocketchat-mongo status | grep Active
Ensure MongoDB is still running with the output:
Active: active (running)
Run the backup command:
sudo snap run rocketchat-server.backupdb
A successful backup will return this:
[+] A backup of your data can be found at /var/snap/rocketchat-server/common/backup/rocketchat_backup_<timestamp>.tar.gz
Start your
rocketchat-server
sudo service snap.rocketchat-server.rocketchat-server start
Copy 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-server
by running this command:sudo service snap.rocketchat-server.rocketchat-server stop
While the
rocketchat-server service
should be stopped, therocketchat-mongo
service 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.tgz
If 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) No
Choose 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-server
sudo 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
Caddyfile
in the following directory and restart the Rocket.Chat service:/var/snap/rocketchat-server/current/ sudo snap restart rocketchat-server
If 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=disable
Edit the Caddyfile found at
/var/snap/rocketchat-server/current/Caddyfile
and write your configuration.Replace
_caddy-url_
and_port_
with your site information. For example, suppose that you haveexample-domain.com
directed 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:3000
Restart Caddy:
sudo systemctl reload snap.rocketchat-server.rocketchat-caddy
Check the status to ensure Caddy started correctly:
sudo systemctl status snap.rocketchat-server.rocketchat-caddy
Once that is tested and resolved, to get secured communications, you can remove the
http://
:
example-domain.com
reverse_proxy localhost:3000
Using 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-caddy
You 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
.
Troubleshooting
Q: 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
Without these connections, AppArmor will block access, resulting in repeated denial messages that could fill system logs and potentially consume significant disk space if log retention is not properly managed.