Nexus Repository 3 Pro stores its installed license using the Java Preferences API. On Linux, the default license storage location for this API is in the home directory of the user that is running the process, under $USER_HOME/.java/.userPrefs/com/sonatype/nexus/professional/prefs.xml.
If the user running Nexus Repository 3 Pro does not have a home directory, or the home directory is not on persistent storage, the license will be lost with every restart.
There are several ways to solve this issue.
Option 1) Create a home directory for the Nexus Repository 3 process user (ensure that Nexus process user can write to the home directory).
Option 2) Follow the instructions in the overriding the installed license file section in our article on license installation methods.
If you are running Nexus Repo in a container:
Be sure to pass this into the INSTALL4J_ADD_VM_PARAMS environment variable along with your other setting overrides:
-Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs