Skip to content

Instantly share code, notes, and snippets.

@linuxfemale
Created November 18, 2019 15:18
Show Gist options
  • Save linuxfemale/71a9914ffb09fa28a5aa77800d84dde4 to your computer and use it in GitHub Desktop.
Save linuxfemale/71a9914ffb09fa28a5aa77800d84dde4 to your computer and use it in GitHub Desktop.
Rocket.Chat
sudo useradd -m -U -r -d /opt/rocket rocket
sudo usermod -a -G rocket www-data
sudo chmod 750 /opt/rocket
su - rocket
sudo passwd rocket
su - rocket
curl -L https://releases.rocket.chat/latest/download -o /tmp/rocket.chat.tgz
tar -xzf /tmp/rocket.chat.tgz -C /tmp
cd /temp
cd Rocket.Chat/programs/server
npm install
sudo mv /tmp/bundle /opt/Rocket.Chat
cat << EOF |sudo tee -a /lib/systemd/system/rocketchat.service
[Unit]
Description=The Rocket.Chat server
After=network.target remote-fs.target nss-lookup.target nginx.target mongod.target
[Service]
ExecStart=/usr/local/bin/node /opt/Rocket.Chat/main.js
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=rocketchat
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01 MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01 ROOT_URL=http://localhost:3000/ PORT=3000
[Install]
WantedBy=multi-user.target
EOF
MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=rs01
MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=rs01
ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000
PORT=3000
sudo sed -i "s/^# engine:/ engine: mmapv1/" /etc/mongod.conf
sudo sed -i "s/^#replication:/replication:\n replSetName: rs01/" /etc/mongod.conf
sudo systemctl enable mongod
sudo systemctl start mongod
mongo --eval "printjson(rs.initiate())"
sudo systemctl enable rocketchat
sudo systemctl start rocketchat
sudo systemctl status rocketchat
http://localhost:3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment