Skip to content

Instantly share code, notes, and snippets.

@kngvamxx
Last active May 10, 2020 08:11
Show Gist options
  • Save kngvamxx/389d4da34b602d4766a4c7e9bf7b74f4 to your computer and use it in GitHub Desktop.
Save kngvamxx/389d4da34b602d4766a4c7e9bf7b74f4 to your computer and use it in GitHub Desktop.
A Rocket. Chat App is an integration or a plugin which is created in an isolated environment. You can also create your own App and publish it on our official Marketplace to share with the world. Users can download your application from the marketplace and use it.
##Step 1: Install MongoDB
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
sudo apt update
sudo apt install -y mongodb-org
sudo systemctl stop mongod.service
sudo systemctl start mongod.service
sudo systemctl enable mongod.service
sudo systemctl status mongod
sudo nano /etc/mongod.conf
#Then copy and paste the lines at the end of the file and save..
replication:
replSetName: "rs01"
# or
echo -e "replication:\n replSetName: \"rs01\"" | sudo tee -a /etc/mongod.conf
sudo systemctl restart mongod
sudo systemctl status mongod
mongo
rs.initiate()
##Step 2: Install Node.js
#Rocket.Chat only support Node.js from the 8.x repository…
sudo apt install nodejs npm build-essential curl software-properties-common graphicsmagick
sudo npm install -g inherits n && sudo n 12.14.0
##Step 3: Install Rocket.Chat Server
sudo useradd -m -U -r -d /opt/rocketchat rocketchat
sudo su - rocketchat
curl -L https://releases.rocket.chat/latest/download -o rocket.chat.tgz
tar zxvf rocket.chat.tgz
mv bundle Rocket.Chat
cd /opt/rocketchat/Rocket.Chat/programs/server
npm install
export ROOT_URL=http://localhost:3000
export MONGO_URL=mongodb://localhost:27017/rocketchat
export MONGO_OPLOG_URL=mongodb://localhost:27017/local?replSet=rs01
export PORT=3000
cd /opt/rocketchat/Rocket.Chat/
node main.js
exit
exit
sudo nano /etc/systemd/system/rocketchat.service
#Then copy and paste the lines below into the file and save…
[Unit]
Description=Rocket.Chat server
After=network.target nss-lookup.target mongod.target
[Service]
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=rocketchat
User=rocketchat
Environment=MONGO_URL=mongodb://localhost:27017/rocketchat MONGO_OPLOG_URL=mongodb://localhost:27017/local?replSet=rs01 ROOT_URL=http://example.com PORT=3000
ExecStart=/usr/local/bin/node /opt/rocketchat/Rocket.Chat/main.js
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable rocketchat
sudo systemctl start rocketchat
sudo systemctl status rocketchat
http://localhost:3000
##Video Tetorial
https://youtu.be/MIYcN05-U9s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment