Restoring an Admin User
You might accidentally lost access to an important admin user (or the only admin in the server) and need to restore it without using another admin user. This guide will help you in this process.
Note: To do this, you will need access to the database
Finding the database
Docker based installations
Open Mongo shell within Mongo container
Change into docker-compose directory (where your docker-compose.yml
is located):
or run
Make sure to replace mongo
with your MongoDB container name in case you use a different one.
Login to mongo shell using :
On the Mongo shell:
Make sure to replace rocketchat
with your actual Mongo database. If you're not sure how it's called either check your docker-compose.yml
file or run:
Ubuntu Snaps
Connect to MongoDB:
Select Ministry.Chat Database:
Updating the admin password
You can either use a one time access token (that will require the user to change his password):
Then access http://{your server url}/login-token/some-token-id-that-you-will-use-to-login-once
to login
or you can update the admin password to 12345
Replace administrator
with the admin username in question.
Make sure to restart your application container in case the new password is not accepted yet.
Reset user role to "admin"
Again, make sure to replace administrator
with the admin username in question.
Last updated