brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: reset a forgotten Portainer admin password with the helper-reset-password image

Portainer
~/tips/tip-portainer-reset-admin-password

docker stop portainer

Resets the Portainer admin password by running a helper container against the data volume.

Locked out of your own Portainer? Do not reinstall it, there is a small helper image for this.

Stop the Portainer container, run the helper against the same data volume, and start Portainer again:

docker stop portainer
docker run --rm -v portainer_data:/data portainer/helper-reset-password
docker start portainer

The helper prints a new random password. Copy it right away, because it is only shown once. If you would rather choose your own, add --password "yourpassword" to the helper command. Portainer hashes it before storing it.

Two caveats. The container must be stopped first. And the volume name in the command has to match yours: portainer_data is the default in the docs, but a bind mount or a different name needs changing. If there is no admin user at all, the helper creates one, and if the name admin is taken, you get admin- plus random characters.

If you want the password to be fixed instead of random, the helper also accepts --password-hash with a bcrypt hash, but you cannot combine it with --password. For a home setup the random one is fine. Put the result in a password manager. After you log in, change it under your user settings if you want something you can remember.

Further reading: Reset the admin password, On this site: start Portainer with –admin-password-file instead of typing the password in time, On this site: add Docker Hub to Portainer's registries with an access token, not your password

More Portainer tips Choose Polling in a Portainer GitOps update when your Git host can't reach Portainer Put Portainer environments in groups and give users access to a whole group Portainer's Edge Agent checks in every 5 seconds, and you can change that docker run -d -p 9001:9001 --name portainer_agent --restart=always \ Deploy the container → Replace All Portainer tips (28) All topics

Link