Can I override Nexus Repository 2 configuration properties with environment variables?

Visit for documentation on Nexus Repository version 2.

A. Nexus Repository 2 will pull in some configuration data from environment variables. If these are defined they will override the values in "$NEXUS_HOME/conf/". For Nexus 2.x the following environment variables can be defined:

    • The location of the Nexus Repository 2 work directory, where Nexus Repository 2 stores all of its configurations and repository contents.
    • Defaults to $(basedir)/../sonatype-work/nexus
    • The host/address(es) that the Nexus Repository 2 server will be listening on
    • Defaults to, which means that Nexus Repository 2 will listen on all network interfaces
    • The port that Nexus Repository 2 will be listening on
    • Defaults to 8081
    • The context path that the Nexus Repository 2 application will be served on
    • Defaults to /nexus

Caution: Generally we suggest avoiding using environment variables to configure Nexus Repository 2 if at all possible.

Caution: In older versions of Nexus Repository 2 these environment variables began with "PLEXUS" instead of "NEXUS".  Use of "PLEXUS" environment variables is deprecated, and support for these will be removed in a future release.

Where is the code which controls the environment variables?

The code location is different per Nexus Repository 2 version. You can grep the Nexus Repository 2 OSS source code for 'NEXUS_' and 'PLEXUS_' to find the locations if the following links no longer work.

Nexus Repository 2.11.x:

Nexus Repository 2.x latest:

Have more questions? Submit a request


Article is closed for comments.