https://www.youtube.com/watch?v=MRnMDaxLtu4&feature=youtu.be


##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 8.11.4
##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/MRnMDaxLtu4