Category: Deployment
Resource links
Updated

This solution is summarized from an archived support forum post. This information may have changed. If you notice an error, please let us know in Discord.

Regain Access to Self-Hosted Account Using Mongodb Command

Issue

I have lost access to the Appsmith applications I was developing locally on a self-hosted instance using Docker. After attempting to reset my password, I created a new user account but couldn't access the applications. I am looking for a configuration tweak to resolve the account disconnect.

Resolution

If you forgot your password and did not configure the Email service for your instance, you can follow the steps from this guide on how to reset the password with the help of the server logs.

Another solution is to reset the account using a MongoDB command. SSH into the server and run the following command in the directory containing the docker-compose.yml file, replacing USER_EMAIL with the email of the account you want to restore:

docker-compose exec appsmith mongo "$(awk -F= '$1 == "APPSMITH_DB_URL" {print $2}' stacks/configuration/docker.env | cut -d '?' -f1)" --eval "db.user.updateOne({email: 'USER_EMAIL'}, {\$set: {source: 'FORM', isEnabled: false}})"

This command resets the user account in the Appsmith MongoDB instance. You can then sign up with your email address to regain access to your account. If you are using this method, please ensure you take a backup of your Appsmith instance before performing the update operation. 

We recommend you use the first method and reset your password by grabbing the password reset link from the server logs, because doing manual changes in the backend MongoDB can lead to data corruption. However, if you still want to proceed with the second method, please ensure you first take a backup of your Appsmith instance.