Created
January 6, 2020 07:14
-
-
Save afahitech/c0bf5121b64a132b4a4dcbaed5c2762e to your computer and use it in GitHub Desktop.
Set Up Rocket Chat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##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-get -y update && sudo apt-get install -y curl && curl -sL https://deb.nodesource.com/setup_8.x | sudo bash - | |
| 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 (problem) | |
| 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 | |
| # youtube : https://youtu.be/bmR-mMOcmRQ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment