Deploying Rocket.Chat on Ubuntu
2017-01-01 15:09
288 查看
https://rocket.chat/docs/installation/manual-installation/ubuntu/
Installing using:
Snaps are secure. Rocket.Chat and all of its dependencies are isolated from the rest of your system. Snaps also auto update when we release a new version. So no need more hassle updating.
Find out more information about snaps
here
update notes
This guide explains how to deploy your own Rocket.Chat instance to a Ubuntu Linux machine using the command line.
MongoDB
curl
graphicsmagick
We have to also install
If you encountered some errors when trying to install
The
In order for some npm packages to work (such as those that require building from source) you will need to install the build-essentials package:
Install a tool to let us change the node version.
Rocket.Chat needs Node.js version 4.5
More on
nodejs installation
MongoDB replica set OPTIONALLY to improve performance via Meteor Oplog tailing. First off, restart the instance/machine.
To configure the replica set:
And restart Mongo:
Restart Mongo:
Start the MongoDB shell and initiate the replica set:
The result should look like this
Note the “ok” value should be 1. Any other value, i/e/ 93, means something is wrong.Make sure to edit the /etc/hosts and /etc/hostname (and restart) to the network accessible DNS name of the machine.
After a few seconds, you should see your prompt turn into
After you configured replica set, you MUST add the following environment variable before restarting Rocket.Chat server for it to take effect:
You may also consider (alternatively) including this value in your ~/.bashrc file:
our releases page):
Then untar the binary release:
This will expand everything into a
Next, make sure MongoDB server is already up and running. Then, set environment variables and run the Rocket.Chat server:
If you used the replica set, you MUST use following line to indicate the usage of the replica set.
You MUST set the
This will start the Rocket.Chat server running.
If you would like to start Rocket.Chat on an alternative port, use the environment variable PORT.
If using port 80 you will have to run as root. This is because it is a privileged port.
If you choose to do this. You need to do something like this:
Or…
If you need to keep the server up and running across reboots, use a task manager such as forever, PM2 or write your own shell management scripts.
Run Rocket.Chat behind a SSL Reverse Proxy
Make sure server is down
Change into the directory where you have the
Remove the old server executables
Repeat Installation
step
You can always
update directly to the newest version, the database migrations will execute from the old version to the new version.
Recommended Fastest Server Install via Snaps
This is the easiest way for you to get your server up and running on all supported Linux (Ubuntu, etc).Installing using:
sudo snap install rocketchat-server
Snaps are secure. Rocket.Chat and all of its dependencies are isolated from the rest of your system. Snaps also auto update when we release a new version. So no need more hassle updating.
Find out more information about snaps
here
Manual install
If coming from Rocket.Chat 0.x.x to 0.40.0 please see ourupdate notes
This guide explains how to deploy your own Rocket.Chat instance to a Ubuntu Linux machine using the command line.
Dependencies
Node.jsMongoDB
curl
graphicsmagick
System Configuration
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 sudo apt-get update sudo apt-get install -y mongodb-org curl graphicsmagick
We have to also install
npm, which is the Node.js package manager. You can do this by typing:
sudo apt-get install npm
If you encountered some errors when trying to install
npmtry to install
nodejsfirst.
The
nodejspackage contains the
nodejsbinary as well as
npm, so you don’t need to install npm separately.
sudo apt-get install nodejs
In order for some npm packages to work (such as those that require building from source) you will need to install the build-essentials package:
sudo apt-get install build-essential
Install a tool to let us change the node version.
sudo npm install -g n
Rocket.Chat needs Node.js version 4.5
sudo n 4.5
More on
nodejs installation
Setup MongoDB Replica Set
Rocket.Chat uses theMongoDB replica set OPTIONALLY to improve performance via Meteor Oplog tailing. First off, restart the instance/machine.
To configure the replica set:
For older MongoDB versions (2.4 and below)
AppendreplSet=001-rsinto
mongod.conffile:
$ echo replSet=001-rs >> /etc/mongod.conf
And restart Mongo:
service mongod restart
For new MongoDB versions (2.6 and above)
Using YAML syntax add this section intomongod.conf:
replication: replSetName: "001-rs"
Restart Mongo:
service mongod restart
Start the MongoDB shell and initiate the replica set:
mongo > rs.initiate()
The result should look like this
{ "info2" : "no configuration explicitly specified -- making one", "me" : "localhost:27017", "info" : "Config now saved locally. Should come online in about a minute.", "ok" : 1 }
Note the “ok” value should be 1. Any other value, i/e/ 93, means something is wrong.Make sure to edit the /etc/hosts and /etc/hostname (and restart) to the network accessible DNS name of the machine.
After a few seconds, you should see your prompt turn into
001-rs:PRIMARY>, this indicates the replica set is being used. Type
exitto get back to your regular shell.
After you configured replica set, you MUST add the following environment variable before restarting Rocket.Chat server for it to take effect:
MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=001-rs
You may also consider (alternatively) including this value in your ~/.bashrc file:
export MONGO_OPLOG_URL=mongodb://localhost:27017/local?replicaSet=001-rs
Install
Download Stable version of Rocket.Chat (or pick a version fromour releases page):
curl -L https://rocket.chat/releases/latest/download -o rocket.chat.tgz
Then untar the binary release:
tar zxvf rocket.chat.tgz
This will expand everything into a
bundledirectory.
Next, make sure MongoDB server is already up and running. Then, set environment variables and run the Rocket.Chat server:
mv bundle Rocket.Chat cd Rocket.Chat/programs/server npm install cd ../.. export ROOT_URL=http://your-host-name.com-as-accessed-from-internet:3000/ export MONGO_URL=mongodb://localhost:27017/rocketchat export PORT=3000 node main.js
If you used the replica set, you MUST use following line to indicate the usage of the replica set.
export MONGO_URL=mongodb://localhost:27017/rocketchat?replicaSet=001-rs
You MUST set the
ROOT_URLenvironment variable to the Internet accessible URL to your server.
This will start the Rocket.Chat server running.
If you would like to start Rocket.Chat on an alternative port, use the environment variable PORT.
If using port 80 you will have to run as root. This is because it is a privileged port.
If you choose to do this. You need to do something like this:
sudo ROOT_URL=http://your-host-name.com-as-accessed-from-internet/ \ MONGO_URL=mongodb://localhost:27017/rocketchat \ PORT=80 \ node main.js
Or…
sudo su export ROOT_URL=http://your-host-name.com-as-accessed-from-internet/ export MONGO_URL=mongodb://localhost:27017/rocketchat export PORT=80 node main.js
If you need to keep the server up and running across reboots, use a task manager such as forever, PM2 or write your own shell management scripts.
Configure
Rocket.Chat is installed and will run, but needs to be configured behind a web server to be accessible. Follow these guides to properly configure everything your instance needs:Run Rocket.Chat behind a SSL Reverse Proxy
Update
In summary do the following:Make sure server is down
Change into the directory where you have the
Rocket.Chatdirectory
Remove the old server executables
rm -rf Rocket.Chat
Repeat Installation
step
You can always
update directly to the newest version, the database migrations will execute from the old version to the new version.
相关文章推荐
- 在Ubuntu上安装、配置和部署Rocket.Chat
- Deploying TinyOS on Ubuntu 10.10
- Deploying ActiveMQ on Ubuntu 8.10
- Install LAMP on Ubuntu 7.10 Desktop
- How to install Ubuntu on low memory systems
- your eclipse on ubuntu is slow? come here
- Installing Robocup 3D simulation server on Ubuntu
- Install oracle-xe-client_10.2.0.1-1.0_i386 on Ubuntu
- BDNradio: Chat room log of live chat with Danny Thorpe on Delphi 2005 - by John Kaster
- 模拟苹果界面:Leopard on Ubuntu
- Nginx HTTP Server + PHP5 (With fast-cgi And xcache) On Ubuntu Feisty Fawn
- BDNradio: Chat room log of live chat with Danny Thorpe on Delphi 2005
- How to enabled nvidia accelerated driver in Ubuntu on my Toshiba Laptop
- Install Xen 3.2 on Ubuntu 7.10 Desktop (amd64)
- java+mysql+ruby+rails+nb6_on ubuntu7.10
- 第一次外国人在qq上找我聊天【为了找php程序员】The first time of foreigners in qq chat on me.
- My Chat Room on line,Welcome you!
- MonoDevelop 0.14 on Ubuntu
- Set up a svn server on a virtual ubuntu
- tips of developing ruby on rails projects on ubuntu