Reset the admin user's password
If your Portainer admin forgets their password, follow these steps to reset it. There are two methods depending on your Portainer environment.

Method 1: Resetting the admin password if Portainer runs as a container

You would typically use this method if you run the Portainer Server on Docker Standalone.
First, go to our reset password container helper in GitHub, then stop the Portainer container by running this command:
1
docker stop "id-portainer-container"
Copied!
Next, run the helper using the following command (you'll need to mount the Portainer data volume):
1
docker run --rm -v portainer_data:/data portainer/helper-reset-password
Copied!
If successful, the output should look like this:
1
2020/06/04 00:13:58 Password successfully updated for user: admin
2
2020/06/04 00:13:58 Use the following password to login: &_4#\3^5V8vLTd)E"NWiJBs26G*9HPl1
Copied!
Finally, use this command to start the Portainer container then try logging in with the new password:
1
docker start "id-portainer-container"
Copied!

Method 2: Resetting the admin password if Portainer runs as a stack/service

You would typically use this method if you run the Portainer Server on Docker Swarm.
First, scale the Portainer service to zero using this command:
1
docker service scale portainer_portainer=0
Copied!
Next, run the reset password container helper using the same bind-mount/volume as the data volume:
1
docker run --rm -v portainer_portainer_data:/data portainer/helper-reset-password
Copied!
If successful, the output should look like this:
1
2020/06/04 00:13:58 Password successfully updated for user: admin
2
2020/06/04 00:13:58 Use the following password to login: &_4#\3^5V8vLTd)E"NWiJBs26G*9HPl1
Copied!
Finally, start up the Portainer service scaling using this command then try logging in with the new password:
1
docker service scale portainer_portainer=1
Copied!
Last modified 6d ago