Aliyun
Deploying Rocket.Chat on Aliyun
You can install Rocket.Chat to Ubuntu VPS on Aliyun.
The recommended VPS configuration is:
  • 2 GB RAM
  • 10 GB disk
  • 2 or 4 cores
However, lower performance configuration has been tested on a VPS with:
  • 1 GB RAM
  • 10 GB disk
  • 1 core
Follow these steps to install Rocket.Chat.

Update Ubuntu repo lists and Install curl

After you ssh to the VPS:
aliyun shell
Run the command:
1
apt-get update
Copied!
followed by:
1
apt-get install curl
Copied!

Install docker

Run this command:
1
curl -sSL https://get.docker.com/ | sh
Copied!
Docker should be installed, verify it:
1
docker ps
Copied!
aliyun docker verify

Install docker-compose

Install docker-compose, follow the latest release instructions
For release 1.5.0, you can use:
1
curl -L https://github.com/docker/compose/releases/download/1.5.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
Copied!
(if or when this is blocked, you'll have to obtain Linux-x86_64 docker-compose binary via other means)
Next, allow execution of docker-compose:
1
chmod +x /usr/local/bin/docker-compose
Copied!

Create directories for Rocket.Chat

First,
1
mkdir /home/rocketchat
Copied!
Then,
1
cd /home/rocketchat
Copied!
Make two more directories for the mongodb database:
1
mkdir data
2
mkdir dump
Copied!

Create customized docker-compose.yml

Create a docker-compose.yml file with the following content:
1
version: '2'
2
3
services:
4
rocketchat:
5
image: rocket.chat:latest
6
restart: unless-stopped
7
volumes:
8
- ./uploads:/app/uploads
9
environment:
10
- PORT=3000
11
- ROOT_URL=http://chat.inumio.com
12
- MONGO_URL=mongodb://mongo:27017/rocketchat
13
- MONGO_OPLOG_URL=mongodb://mongo:27017/local
14
- Accounts_UseDNSDomainCheck=True
15
depends_on:
16
- mongo
17
ports:
18
- 8818:3000
19
20
mongo:
21
image: mongo
22
restart: unless-stopped
23
volumes:
24
- $PWD/data:/data/db
25
- $PWD/dump:/dump
26
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1
27
28
# this container's job is just run the command to initialize the replica set.
29
# it will run the command and remove himself (it will not stay running)
30
mongo-init-replica:
31
image: mongo
32
command: 'bash -c "for i in `seq 1 30`; do mongo mongo/rocketchat --eval \"rs.initiate({ _id: ''rs0'', members: [ { _id: 0, host: ''localhost:27017'' } ]})\" && s=$? && break || s=$?; echo \"Tried $i times. Waiting 5 secs...\"; sleep 5; done; (exit $s)"'
33
depends_on:
34
- mongo
Copied!
Make sure you customize the file with your-ip-address in the MONGO_URL env variable.

Pull the required docker images

This will download the required docker images, and may take some time.
This is done only the first time, or when you want to update Rocket.Chat.
1
docker pull mongo
2
docker pull registry.rocket.chat/rocketchat/rocket.chat
Copied!

Start the mongodb database

Run:
1
docker-compose up -d mongo
Copied!
Mongo supports 24 x 7 operations and live backup. You should not need to restart it too frequently. See mongodb documentations for proper operation and management of a mongo server.
Wait a couple of minute for mongo to start properly.

Start the mongodb replica

Run:
1
docker-compose up -d mongo-init-replica
Copied!
This container's job is just to run the command to initialize the replica set. It will run the command and remove itself (it will not stay running)

Start your Rocket.Chat server

Now start the Rocket.Chat server:
1
docker-compose up -d rocketchat
Copied!
Rocket.Chat should be ready in a minute or two.

Access your Rocket.Chat on Aliyun

Your Rocket.Chat server can now be accessed over the Internet via:
1
http://your-ip-address:8818/
Copied!
Last modified 6mo ago