We talked about Chat Server like IRC. Rocket.Chat is a Chat Server Application to Host Own Chat Service With Mobile Apps. Here are Steps to Install Rocket.Chat on Ubuntu 14.04. It is a Free Software and needs 1 GB of RAM, we have VPS Dime 6GB RAM server at $7/month cost, Host1Plus at very lower price per month. Host1Plus has support for installing Software at extra fees. KeyCDN is our CDN and they are one of the sponsor of the project.
Why You Will Like to Install Rocket.Chat on Ubuntu
It can run on your server as another web application beside WordPress and Forum Software. Nginx is already installed, just create a subdomain and have TLS certificate installed on the subdomain. So, the server block will be easy.
You can chat with audio and video, website visitors can contact you in real-time, you can share files, integrate your chat to multiple services including GitHub, GitLab, client applications are available for GNU/Linux, Windows and OS X, there are mobile applications.
---
We need MongoDB and NodeJS apart from Nginx.
First Expert Way to Install Rocket.Chat on Ubuntu 14.04 LTS
1 2 3 4 5 6 7 | apt-get install git && add-apt-repository ppa:chris-lea/node.js apt update && sudo apt-get install nodejs apt-get install mongodb curl https://install.meteor.com/ | sh git clone https://github.com/RocketChat/Rocket.Chat.git cd Rocket.Chat sudo meteor |
Go to http://your_server_ip:3000
. Done
Second Expert Way to Install Rocket.Chat on Ubuntu 14.04 LTS With Docket At Port 80
1 2 3 4 5 6 7 8 9 | sudo apt-get install -y git curl -sSL https://get.docker.com/ | sh curl -L https://github.com/docker/compose/releases/download/VERSION_NUM/docker-compose-`uname -s`-`uname -m` > sudo /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose curl -L https://github.com/docker/compose/releases/download/1.4.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose git clone https://github.com/RocketChat/Rocket.Chat.git cd Rocket.Chat sudo docker-compose up |
Go to http://server_ip:80
. Done.
Third Step by Step Way to Install Rocket.Chat on Ubuntu 14.04 LTS With Nginx Reverse Proxy
This is recommended. Add key, set repo for MongoDB, update :
1 2 3 | sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list apt update && apt upgrade |
Install the components :
1 | apt-get install npm mongodb-org curl graphicsmagick nginx-extras |
These are NPM related commands, if you are not used, may read their documents, just follow the screen instructions :
1 | sudo npm install -g n && sudo n 0.10.40 |
Take that, domain name is jima.in
, we thought the subdomain as chat.jima.in
, we have basic setup of Nginx for that server block, added chat.jima.in
via DNS service to point and /usr/share/nginx/html/Rocket.Chat
as root location. Now we can download the rocket.chat
from their server or from Github :
1 | https://github.com/RocketChat/Rocket.Chat.Docs.git |
https://rocket.chat/releases/latest/download
Do a ls
and check the files, bundle and install :
1 2 3 | mv bundle Rocket.Chat cd Rocket.Chat/programs/server npm install |
We need to go 2 level up to go to Rocket.Chat
dir :
1 2 3 | mv bundle Rocket.Chat cd .. && ls cd .. && ls |
We to set ROOT_URL
, port
and MongoDB URL
:
1 2 3 | export ROOT_URL=https://chat.jima.in/ export MONGO_URL=mongodb://localhost:27017/rocketchat export PORT=3000 |
Run Rocket.Chat with the command :
1 | node main.js |
Now, we need to work with Nginx :
1 | nano /etc/nginx/sites-enabled/default |
This is reverse proxy :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | server { listen 443; server_name chat.jima.in; error_log /var/log/nginx/rocketchat.access.log; # SSL stuffs here ssl on; # Add SSL stuffs here location / { proxy_pass http://chat.jima.in:3000/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forward-For $proxy_add_x_forwarded_for; proxy_set_header X-Forward-Proto http; proxy_set_header X-Nginx-Proxy true; proxy_redirect off; } } |
Run configtest with nginx -t
and complete the full work :
1 2 3 4 5 6 7 | cd ~/Rocket.Chat node main.js sudo npm install -g forever sudo npm install -g forever-service Now, let's make sure we're still in the Rocket.Chat directory: sudo forever-service install -s main.js -e "ROOT_URL=https://chat.jima.in/ MONGO_URL=mongodb://localhost:27017/rocketchat PORT=3000" rocket chat sudo start rocketchat |
Now, got to the front-end like https://chat.jima.in/
and complete the browser based installation.