How to reset the Nginx Proxy Manager login & password

So you had a fat finger or senior moment and have forgotten your login deets. Its all good, continue reading.

Now this guide makes some assumptions so it will not work for all installs. If you apply some free form thinking I’m sure you can make it work for your scenario. For this guide I am going to assume you are using a single NPM container docker install and that the standard sqllite DB is in use. I run linux, if you do not you will need to adapt your steps. Good luck

Lets run some commands on the machine running the docker container containing the database but replacing <container-name> with the name of the docker container containing your NPM instance.

*you can check the name of the container from the CLI by typing “docker ps”, this should list your running containers.

docker exec -it <container-name> sh
apt update && apt install sqlite3 -y
sqlite3 /data/database.sqlite

Righto you are now ready to make some changes to the DB. Lets go and delete some users.

UPDATE user SET is_deleted=1;
.exit
exit

you will now need to restart NPM and it will generate the default user account. Once its restarted forth and access the web UI on port 81 and use the default logon info.

Default NPM logon details

Login: admin@example.com
pass: changeme

this will allow you to log back in, create another user etc. “but where have all my things gone” you may be saying. Let me tell you where, they are under the other user account. No need to panic,nginx is still doing its thing. Unless you have done something wrong all config should be fine. Go forth and create a new account, ideally with a different email address and username.

Now onto re-enabling the old account and then use the new account to change the password of the old one. To re-enable it, once again execute the following commands.

docker exec -it <container-name> sh
sqlite3 /data/database.sqlite

Don’t just copy paste silly, make sure you use the right container name, we looked it up earlier.

Now lets set all users to not deleted:

UPDATE user SET is_deleted=0;
.exit
exit

The old accounts are active again, log into the new account, fix your old account with it and you should be good to go. Cleanup the new account you created, or not. You decide its your environment after all.

As with all guides by following these steps you do this at your own risk, understand what you are doing and running before you run the commands or code on your own system. Trust no one.

By arkique