'Nexus `admin.password` file is missing in version 3.28.1

I've created a Nexus server using the official Docker image from Sonatype. My version is 3.28.1 and I can't find admin password or admin.password file in the usual place.

cat /opt/sonatype/sonatype-work/nexus3/admin.password

I've also tried default admin password admin123 and it did not work?

I could not find any release notes about this change and I would like to know where to find the admin password.

Thanks in advance.



Solution 1:[1]

Are you using the sonatype/nexus3 image? Then it should be in /nexus-data.

If it's not there, then the only solution I've found was to remove all the contents of the /nexus-data directory and restart the container. That should initialize a new config, including a new admin password, which should now be available at /nexus-data/admin.password.

Solution 2:[2]

Make docker container using following command

$ docker volume create --name nexus-data
$ docker run -d -p 8081:8081 --name nexus -v nexus-data:/nexus-data sonatype/nexus3

Then you will find admin.password file in /nexus-data folder. Run following command to see default password!

$ docker exec -it nexus /bin/bash
bash-4.4$ cat /nexus-data/admin.password

For more detailed comment, check following url

https://hub.docker.com/r/sonatype/nexus3/#user-content-persistent-data

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Frans
Solution 2