I forgot my OctoPrint password, how can I reset it?

You'll need to do this via the command line (e.g. by SSHing into your Pi or other machine that OctoPrint is installed on - note that the password for SSHing into the Pi is not the one you use to access OctoPrint's web interface, on OctoPi it defaults to the username "pi" and password "raspberry").

If you are running OctoPrint 1.3.12 or later

  • SSH into your machine
  • Activate the virtual environment. On OctoPi: source ~/oprint/bin/activate
  • Run octoprint user password <user> with <user> being the name of the user for whom you want to reset the password, e.g. octoprint user password test for changing the password of the user named test. It will prompt you for a new password and then set it on the user.

If you only have a single user set up

If you only have a single user setup in OctoPrint for which you forgot the password, the easiest way is simply resetting OctoPrint's user database and run the first time setup wizard again. The steps involved boil down to this:

  • remove ~/.octoprint/users.yaml
  • in ~/.octoprint/config.yaml replace firstRun: false with firstRun: true
  • restart the OctoPrint server and reload, you should be prompted to run the first time setup wizard again

If you are running OctoPi, you can use these commands to do all that:

rm ~/.octoprint/users.yaml
sed -i -e 's/firstRun: false/firstRun: true/g' ~/.octoprint/config.yaml
sudo service octoprint restart

:spiral_notepad: Note:

If you have the OctoPrint server installed on Windows, the location of the files will be %APPDATA%\OctoPrint\users.yaml and %APPDATA%\OctoPrint\config.yaml. If you have it installed on MacOS, the locations will be ~/Library/Application\ Support/OctoPrint/users.yaml and ~/Library/Application\ Support/OctoPrint/config.yaml.

If you have multiple users set up

If you have multiple users configured which you don't want to lose, you have two options:

  1. If you have another user that's configured with admin rights, ask them to reset your password via "Settings" > "Access Control"
  2. If you are the only admin user, do the following:
    • make a backup copy of users.yaml, e.g.: cp ~/.octoprint/users.yaml ~/.octoprint/users.yaml.bck
    • run the first time setup wizard again like explained above
    • open the the newly created users.yaml in a text editor - there will only be one entry, your new admin account, copy all of those lines
    • open the backed up version of users.yaml in a text editor, locate your user account therein and replace all its lines with those you just copied from the newly created users.yaml
    • delete the newly created users.yaml and rename your backup version - now modified with your new credentials - into users.yaml again, e.g. mv ~/.octoprint/users.yaml.bck ~/.octoprint.users.yaml
    • restart OctoPrint, you should then be able to login with your new password
6 Likes

Where should I run these commands?
rm ~/.octoprint/users.yaml
sed -i -e 's/firstRun: false/firstRun: true/g' ~/.octoprint/config.yaml
sudo service octoprint restart

You have to connect to the RasPi via SSH (e.g. with PuTTy)

I tried to do this tonight and the first time setup wizard does not run. It just sits there with normal home page but all the details are blank and there is a login button on the top right that does nothing when I click it. I have rebooted several times.

Edit: Figured it out, emberassingly, answer below for anyone dumb enough to make my mistake.

Did you try to reset your browsers cache or to use another browser?

So I am willing to admit to being an IDIOT. This might be a suggestion for Foosel though. So I am out of town and was connecting to my printer instances through a remote connection to the server I have running at home. Well I I had forgotten that while I was trying to get around some dumb stuff on another site I diasbled javascript. I'm an idiot. I figured it out when I went to try clearing cache and I saw that it was disabled..

Now for the suggestion for Gina. Octoprint's behavior when you have javascript disabled doesn't do a good job of indicating that your problem is related to javascript.. It might be worthwhile to have a warning modal when javascript is disabled. Don't believe me? Disable javascript and try to connect, it's non obvious. But since this isn't a machine I actually do any browsing on I didn't notice that it was disabled because I almost never use the browser for anything other than my octoprint servers.

I give you permission to make fun of me.

1 Like

"HA... HA...!" /NelsonMuntz /Simpsons

(It's entirely possible that I would have still said that without your permisson.)

How about... here:

  <noscript>Hey tenthrow, turn on JavaScript!</noscript>
2 Likes

Will be in 1.4.0.

edit and @OutsourcedGuru was close:

3 Likes

This is a great suggestion. Thank you!