Rocket.Chat

Setup Rocket.Chat locally with Docker

For a minimal effort local Rocket.Chat installation follow the steps below.

$ docker pull rocket.chat
$ docker run --name db -d mongo:latest --replSet rs0 --oplogSize 128
$ docker exec -ti db mongosh --eval "printjson(rs.initiate())"
$ docker run --name rocketchat -p 80:3000 --link db --env ROOT_URL=http://chat.mydomain.local --env MONGO_OPLOG_URL=mongodb://db:27017/local -d rocket.chat

## Add 'chat.mydomain.local' to /etc/hosts
$ docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' rocketchat
$ vim /etc/hosts 

Open your browser and go to http://chat.mydomain.local, follow the Wizard to create your first Administrator account. One step 4/4 you'll get stuck pending verification, we can bypass this by manually setting Show_Setup_Wizard to complete in the database.

$ docker exec -it db /bin/bash
root@44f612268905:/# mongosh
test> show databases
test> use meteor
meteor> db.rocketchat_settings.update({"_id":"Show_Setup_Wizard"}, {$set: {"value" : "completed"} });

Everything is now complete and you should be able to use your Rocket.Chat application.

Users management

Change password of user void to ABCabc12345! through the database:

$ htpasswd -bnBC 10 "" ABCabc12345! | tr -d ':\n' | sed 's/$2y/$2b/' 
$2b$10$8oLZ2yx961NDc/F.jY77XOiUCCmdMeC9OvjuqKySeX48EzgTCX.Qy

meteor> show collections
meteor> db.users.find()
meteor> db.users.updateOne( {username:"void"}, { $set: {"services" : { "password" : {"bcrypt" : "$2b$10$8oLZ2yx961NDc/F.jY77XOiUCCmdMeC9OvjuqKySeX48EzgTCX.Qy" } } } })

Last updated