Reset the admin user's password
Was this helpful?
Was this helpful?
If your Portainer admin forgets their password, follow these steps to reset it. There are three methods depending on your Portainer environment.
First, go to our in GitHub, then stop the Portainer container by running this command:
Next, run the helper using the following command (you'll need to mount the Portainer data volume):
If your Portainer data volume has a different name than portainer_data
or you are using a bind mount for your data volume, you will need to adjust the mount in the below docker run
command to suit your path.
If successful, the output should look like this:
If the helper is unable to find an admin user to update, it will create a new one for you. If the username admin
is already used, it will create a user named admin-[randomstring]
:
Finally, use this command to start the Portainer container then try logging in with the new password:
First, scale the Portainer service to zero using this command:
If your Portainer data volume has a different name than portainer_data
or you are using a bind mount for your data volume, you will need to adjust the mount in the below docker run
command to suit your path.
If successful, the output should look like this:
If the helper is unable to find an admin user to update, it will create a new one for you. If the username admin
is already used, it will create a user named admin-[randomstring]
:
Finally, start up the Portainer service scaling using this command then try logging in with the new password:
First, scale the Portainer deployment to zero using this command:
Create the password reset pod using the command below:
Once the new pod is created and transitions into a completed state, you can see the new password in the pod logs:
If successful, the output should look something like this:
Finally, scale up the Portainer deployment using this command then try logging in with the new password:
You can delete the password reset pod using the below command:
Next, run the using the same bind-mount/volume as the data volume:
Next, create a pod using the image and mount the Portainer data volume. Create a pod YAML file using the command below: