docker-desktopwindows-11metabase

Resetting admin password of Metabase in Docker Desktop Windows 11


Good day.

How do I reset the admin password of Metabase that is installed using Docker Desktop on Windows 11?

Thanks.


Solution

  • Part of the answer can be found here. The guide says,

    If you’re a Metabase admin and have access to the server console, you can get Metabase to send you a password reset token:

    Stop the running Metabase application. Restart Metabase with reset-password email@example.com, where “email@example.com” is the email associated with the admin account: java -jar metabase.jar reset-password email@example.com

    MODIFYING THE FILE

    On Docker Desktop, what you need to do is to modify run_metabase.sh and add the reset-password flag as described above.

    1. On Docker Desktop, this is easy. In Containers, look for Metabase. Under action, click on the 3-dotted button, and select View Files. Under app folder, select run_metabase.sh to open the file.
    2. Add the reset-password flag with the admin email as described above. In my case, I modified line 172. Save the file.

    enter image description here

    At this point, you can now restart and continue following the guide above. However, if you were like me, you will encounter a permission denied error and Metabase won't start successfully as before. Modifying and saving the file in the Docker Desktop editor removed the execute flag of the file.

    FIXING THE Permission Denied Error

    To reset the file's permission, open a terminal in the WSL guest you are using.

    1. Navigate to /mnt/wsl/docker-desktop-data/version-pack-data.
    2. Perform a search of the run_metabase.sh file using find . -name run_metabase.sh. This will give you the location of the file.
    3. Using that location, modify the permission of the file using chmod +x path/to/run_metabase.sh.
    4. On Docker Desktop, try to run the Metabase again. It should work now. Copy the reset-password token provided in the terminal logs.

    At this point, you need to revert the changes you've made in the run_metabase.sh file, reset the permission as described above, then restart Metabase again. You can now access the reset-password link and use the token obtained previously to reset the password of your Metabase admin account.

    I hope this helps.