https://rocket.chat/docs/installation/manual-installation/debian/
cat > /etc/systemd/system/rocketchat.service <<EOF
[Unit]
Description=Rocket.Chat
After=network.target
Wants=network.target
[Service]
ExecStart=$(command -v node) main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=rocketchat
WorkingDirectory=/opt/Rocket.Chat
Environment=MONGO_URL=mongodb://127.0.0.1:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://127.0.0.1:27017/local?replicaSet=rs01 ROOT_URL=http://127.0.0.1:3000/ PORT=3000
Type=simple
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target
EOF