Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to reset admin password Mailcow Docker? #76

Closed
garybsimon opened this issue Feb 26, 2017 · 6 comments
Closed

How to reset admin password Mailcow Docker? #76

garybsimon opened this issue Feb 26, 2017 · 6 comments

Comments

@garybsimon
Copy link

Hi,

I'm stucked at login screen.
How can change the admin password at Mailcow Docker version?
The old password change methods don't work.

Please let me know.
Thanks.

Great work.

@PhoenixPeca
Copy link
Contributor

Hi @garybsimon,
If you're in a new install of mailcow-dockerized. The default login credentials for admin is:
Username: admin
Password: moohoo

For resetting a forgotten admin password, please refer to the docs: https://mailcow.email/dockerized/?c=IV.%20Usage%20and%20Examples&p=Reset_admin.md

@garybsimon
Copy link
Author

I have tried to get a new password or reset the db but I got this message:

source mailcow.conf
mailcow-reset-admin#: command not found

Need assistance :)

@PhoenixPeca
Copy link
Contributor

Hi @garybsimon,
I haven't tried resetting mailcow-dockerized with this method. But I think before you can reset it, you need to change directory into the cloned repo in your home directory first.

Try to execute this:
cd ~/mailcow-dockerized/

source mailcow.conf

docker-compose exec mysql-mailcow mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "DROP TABLE admin;"

@i3i2ain
Copy link

i3i2ain commented Jun 11, 2021

Hi @garybsimon,
I haven't tried resetting mailcow-dockerized with this method. But I think before you can reset it, you need to change directory into the cloned repo in your home directory first.

Try to execute this:
cd ~/mailcow-dockerized/

source mailcow.conf

docker-compose exec mysql-mailcow mysql -u${DBUSER} -p${DBPASS} ${DBNAME} -e "DROP TABLE admin;"

DO NOT delete the admin table. This will break the whole installation. It cost me like 1 day to recover everything since I did not have any backup.

Use the official way / script from here: https://mailcow.github.io/mailcow-dockerized-docs/debug-reset_pw/

@esstat17
Copy link

I recently have a problem, maybe it can help.

Show all running containers

docker compose ps -a

Login to your docker container

docker exec -it sh mailcowdockerized-mysql-mailcow-1

See password from mailcow.conf

mysql -uroot -p{PASSWORD} mailcow

To list the tables within the mailcow database, you can use the following SQL command:

MariaDB [mailcow]> SHOW TABLES;

SHOW TABLES;

Show admins

SELECT * FROM admin;

Change password for user admin. Replace it with the actual username

UPDATE admin SET password = '{BLF-CRYPT}$2y$10$NEW_PASSWORD_HASH' WHERE username = 'admin';

Remember to replace NEW_PASSWORD_HASH with the actual hash of the new password you want to set.

@Tariquaf
Copy link

Tariquaf commented Jul 9, 2024

  1. Login to SSH

  2. Change directory
    cd /opt/mailcow-dockerized

  3. Run following script
    ./helper-scripts/mailcow-reset-admin.sh

  4. Type y and enter

It will reset your password and will display new password

Please note that this only changes the administrator password and not your password for SoGo or IMAP/SMTP logins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants