How to Install Rocket Chat on Ubuntu 16.04 with Docker

Rocket.Chat is a Web Chat Server, developed in JavaScript. It is an open source messaging APP built with Meteor fullstack framework. It is a great solution for communities and companies who need to host their own private chat service or for developers who're planning to build and evolve their own chat platforms. There are several features for this Chat APP. Some of the major features includes video conferencing, file sharing, voice messages, helpdesk chat, link preview, fully-featured API, extendablility, native applications, mobile applications and lot more.

In this article, I'm providing you with the step by step instructions on how to install our Rocket.Chat on a Docker container.

 Step 1 - Installing Git

We can install Git packages from their repositories by just running this command. Git packages are used to clone the project repository.

root@ubuntu:~# apt-get update
root@www:~# apt-get install -y git
Reading package lists... Done
Building dependency tree
Reading state information... Done
git is already the newest version (1:2.7.4-0ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 105 not upgraded.
root@www:~# git clone https://github.com/RocketChat/Rocket.Chat.git
Cloning into 'Rocket.Chat'...
remote: Counting objects: 55385, done.
remote: Compressing objects: 100% (177/177), done.
remote: Total 55385 (delta 69), reused 0 (delta 0), pack-reused 55207
Receiving objects: 100% (55385/55385), 37.48 MiB | 10.80 MiB/s, done.
Resolving deltas: 100% (38031/38031), done.
Checking connectivity... done.

Step 2 - Installing Docker

Docker simplifies this installation process. Docker is an open-source project that automates the deployment of applications inside software containers. You can either install docker by apt-get install docker-engine command or you can use this below command to get the latest Docker package.

curl -sSL https://get.docker.com/ | sh

Step 3  - Installing Docker-Compose

Compose is a docker tool for defining and running multi-container applications with Docker. Using this tool, you define a multi-container application in a single file, and run that file using a single compose command to spin your application up and running. You can install the docker compose either using apt-get install docker-compose or using this below command to download the latest docker compose version:

curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

You can get the latest docker compose releases and download those instead.

Step 4 - Cloning Rocket.chat

Before installing, we need to clone our Rocket.chat repository using git to a folder named Rocker.Chat.

root@www:~# git clone https://github.com/RocketChat/Rocket.Chat.git
Cloning into 'Rocket.Chat'...
remote: Counting objects: 55385, done.
remote: Compressing objects: 100% (177/177), done.
remote: Total 55385 (delta 69), reused 0 (delta 0), pack-reused 55207
Receiving objects: 100% (55385/55385), 37.48 MiB | 10.80 MiB/s, done.
Resolving deltas: 100% (38031/38031), done.
Checking connectivity... done.

Step 5 - Installing Rocket.chat

Now move to the Rocker.Chat folder  and run our docker-compose file.

root@www:~# cd Rocket.Chat
root@www:~/Rocket.Chat# docker-compose up

docker-compose

root@www:~/Rocket.Chat# docker-compose up
Pulling mongo (mongo:latest)...
latest: Pulling from library/mongo
5c68a10e9f3f: Pull complete
0110f95fa9c8: Pull complete
0cba4a42bc41: Pull complete
a6eafd7fba3f: Pull complete
703d9d7e0e21: Pull complete
6c18d5bc22c9: Pull complete
fd3fcba178e3: Pull complete
c8b9b5488049: Pull complete
41f37d58ab4c: Pull complete
Digest: sha256:beff97308c36f7af664a1d04eb6ed09be1d14c17427065b2ec4b0de90967bb3f
Status: Downloaded newer image for mongo:latest
Creating rocketchat_mongo_1
Pulling hubot (rocketchat/hubot-rocketchat:v0.1.4)...
v0.1.4: Pulling from rocketchat/hubot-rocketchat

ddf65d6bb23c: Pull complete
Digest: sha256:e4c7dccc4ec00f24dd7e25febc9cf0b653df085ea42eb605fcd8409736d52559
Status: Downloaded newer image for rocketchat/hubot-rocketchat:v0.1.4
Creating rocketchat_hubot_1
Attaching to rocketchat_mongo_1, rocketchat_rocketchat_1, rocketchat_hubot_1

Running this composer file, will start downloading all the required images as specified in the docker compose file and create all three instances required for our Rocket.Chat as highlighted.

root@www:~/Rocket.Chat# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
db701321e7a2 rocketchat/hubot-rocketchat:v0.1.4 "/bin/sh -c 'node -e " 4 hours ago Up 4 hours 0.0.0.0:3001->8080/tcp rocketchat_hubot_1
f1f2c9476121 rocketchat/rocket.chat:latest "node main.js" 4 hours ago Up 4 hours 0.0.0.0:3000->3000/tcp rocketchat_rocketchat_1
082f45829ae5 mongo "/entrypoint.sh mongo" 4 hours ago Up 4 hours 27017/tcp rocketchat_mongo_1

We can view the Rocket.Chat version and configuration information during the installation phase.

rocketchatinstall

That's all!! We've completed with the Rocket.Chat installation. You can access you chat application using the URL >>http://DockerIP:3000

Rocket.Chat(1)

You can register your new email account and start creating our own private group chats.

Step 6 - Managing the users and Groups

Probably, the first user registered and logged in, will be the admin user and all other user logins will be secondary ones.

Rocket.Chat(3)

You can create your own Channels/groups and set the privacy as needed. You can use the '+' icon near the Channels section to add any number of groups.

Rocket.Chat(4)

Click on the Members list options present on the right hand side to add required users to your new channel. In addition, you can use the individual user tabs below to set the user privileges.

Rocket.Chat(5)

Rocket.Chat(6)

Refer this document for more details on managing this. I hope this article is useful for you. I would recommend your valuable comments and suggestions on this. Happy Chatting!!

About Saheetha Shameer

I'm working as a Senior System Administrator. I'm a quick learner and have a slight inclination towards following the current and emerging trends in the industry. My hobbies include hearing music, playing strategy computer games, reading and gardening. I also have a high passion for experimenting with various culinary delights :-)

Author Archive Page

Have anything to say?

Your email address will not be published. Required fields are marked *

All comments are subject to moderation.

4 Comments

  1. Hello,

    thanks for this manual,
    the installation works well!
    but I have a problem, after a restart, Docker comes not up again, witch command do i need for?
    May it´s possible to let Rocket Chat start automatically after a reboot?

    Regards

  2. Need help.

    I followed the instructions and everything worked great. After I turned on the computer at a later date, I got the following messages and was not able to run RocketChat. Since I am new to this stuff, I do not know how to interpret the messages and would greatly appreciate some help:

    mongo_1 | 2016-12-20T20:26:18.867+0000 W - [initandlisten] Detected unclean shutdown - /data/db/mongod.lock is not empty.
    mongo_1 | 2016-12-20T20:26:18.867+0000 W STORAGE [initandlisten] Recovering data from the last clean checkpoint.

    mongo_1 | 2016-12-20T20:26:20.345+0000 W STORAGE [initandlisten] Detected configuration for non-active storage engine mmapv1 when current storage engine is wiredTiger
    mongo_1 | 2016-12-20T20:26:20.345+0000 I CONTROL [initandlisten]
    mongo_1 | 2016-12-20T20:26:20.345+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
    mongo_1 | 2016-12-20T20:26:20.345+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
    mongo_1 | 2016-12-20T20:26:20.345+0000 I CONTROL [initandlisten]
    mongo_1 | 2016-12-20T20:26:20.345+0000 I CONTROL [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
    mongo_1 | 2016-12-20T20:26:20.346+0000 I CONTROL [initandlisten] ** We suggest setting it to 'never'
    mongo_1 | 2016-12-20T20:26:20.346+0000 I CONTROL [initandlisten]
    mongo_1 | 2016-12-20T20:26:20.417+0000 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
    mongo_1 | 2016-12-20T20:26:20.417+0000 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker
    mongo_1 | 2016-12-20T20:26:20.417+0000 I NETWORK [initandlisten] waiting for connections on port 27017
    mongo-init-replica_1 | connecting to: mongo/rocketchat
    mongo-init-replica_1 | 2016-12-20T20:26:20.311+0000 W NETWORK [thread1] Failed to connect to 172.17.0.2:27017, reason: errno:111 Connection refused
    mongo-init-replica_1 | 2016-12-20T20:26:20.311+0000 E QUERY [thread1] Error: couldn't connect to server mongo:27017, connection attempt failed :
    mongo-init-replica_1 | connect@src/mongo/shell/mongo.js:231:14
    mongo-init-replica_1 | @(connect):1:6
    mongo-init-replica_1 |
    mongo-init-replica_1 | exception: connect failed
    rocketchat_mongo-init-replica_1 exited with code 1
    mongo_1 | 2016-12-20T20:26:21.420+0000 I REPL [rsSync] transition to primary complete; database writes are now permitted
    rocketchat_rocketchat_1 exited with code 1