Skip to main content

Ricardo Mendes

Rocket.chat tip : How to reclaim or define a user as Administrator ?
I'm using at work (armada.digital) and we removed our orginal cloudron user that by default was set to admin role because it was the first user to login into our rocket.chat instance.

the result is we lost admin access to our own rocket.chat app but thanks to Cloudron and Rocket.chat support teams this is how you can fix this situation (this can also happen outside of Cloudron usage)

$ cloudron login armada.digital

to get your app id :
$ cloudron list (to get the app ID)
to get inside the app container :
$ cloudron exec --app

Log-in into mongodb :
$ mongo -u "${MONGODB_USERNAME}" -p "${MONGODB_PASSWORD}" ${MONGODB_HOST}:${MONGODB_PORT}/${MONGODB_DATABASE}
$ > db.users.find({ roles: "admin" }) # should reveal nothing now
$ > db.users.update({ username: "YOURUSERNAME" }, { $set: {roles: [ "user", "admin" ] }})

Now the new admin should show up:
$ > db.users.find({ roles: "admin" })

and there we go, refresh your clients and your user should be admin !

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.