This guide uses /opt but feel free to choose a different directory.
Configure the Rocket.Chat service
Add the rocketchat user and set the right permissions on the Rocket.Chat folder.
Create the Rocket.Chat service file.
Open the service file (/lib/systemd/system/rocketchat.service) using sudo and update the ROOT_URL environmental variable to reflect the URL you are using to access the server. Optionally, you can change MONGO_URL, MONGO_OPLOG_URL and PORT.
Set up storage engine and replication for MongoDB.
Enable and start MongoDB with the following command
Then, initiate replica set with this command:
Enable and start your Rocket.Chat workspace now using this command:
Configure your Rocket.Chat server
To access your Rocket.Chat workspace, open a web browser and navigate to the specified ROOT URL (http://your-host-name.com-as-accessed-from-internet:3000). Follow the configuration prompts to configure your workspace.