Configuring the Runtime Environment

Configuring the specifics of the repository manager runtime involves configuration for all components in various configuration files and startup scripts. This section details these and provides recipes for specific tasks. The startup of the JVM running the repository manager is managed via files in the $install-dir/bin directory within the installation. The application startup is performed with the JVM configuration in the file $install-dir/bin/nexus.vmoptions:


The main location for configuration files is the etc directory. It includes one properties file and a number of nested directories:

$ ls -1 nexus-<version>/etc


Configuration files for Ehcache, Elasticsearch, and OrientDB


Configuration files for Apache Karaf, including:

    • - The main configuration for the Apache Karaf runtime. This file should not be modified.
    • - Customizable configuration used by Apache Karaf. This file can be used to pass additional parameters to the Apache Karaf container.
    • org.apache.* and org.ops4j.* - various Karaf and OSGi related configuration files
    • - system properties used for the JVM and application start up


Configuration files for Eclipse Jetty


Configuration files for logback including:

    • logback.xml - Contains default logger definitions for log file names, log levels, pattern layouts and rotation rules for the nexus.log and tasks/*.log files 
    • logback-access.xml - Contains the default logger definition for the log file name, log level, pattern layout and rotation rules for the request.log file

See Logging and Log Viewer for more information on repository manager logging and the recommended approach for adjusting the logging configuration to meet your needs.

Default properties file for the application providing default values such as the ports used for HTTP and HTTPS access, as well as the context path and host. Override these defaults in $data-dir/etc/ This file should not be modified. The defaults in $data-dir/etc/ is created the first time Nexus is started. You can copy the to $data-dir/etc/ and customize before having to start Nexus the first time.


A directory to put keystores when configuring HTTPS

Updating Memory Allocation and other JVM Parameters

The default and maximum heap sizes for the repository manager are a value of 1200M, suitable for most usage patterns. As a Java application running on the JVM the repository manager is using JVM configuration parameters for numerous settings as part of the startup parameters for the JVM. These values are defined in the configuration file $install-dir/bin/nexus.vmoptions. Increased memory configuration can be set with e.g.:


Other JVM parameters such as GC algorithm can be configured in the same location.

See our System Requirements Memory section for more information and guidance on specific numbers.

Changing the HTTP Port

The default value for the HTTP port used to access the repository manager user interface and resources is 8081. Therefore the user interface would be available at  http://localhost:8081/. To change or update the port, locate the line application-port=8081 in $data-dir/etc/, then edit the number. Here is an example where you would change the port to 9081:


Therefore, the exposed URL will be http://localhost:9081/.

Or setup HTTPS

Additionally, or instead, your use case may require you to run your server on HTTPS.  This includes both business policy and usage of some NXRM features or repository formats.  See our security article on setting up SSL for the means to do this.

Changing the Context Path

To change or update the context path in the instance you want point to a specific webapp or component, locate the nexus-context-path=/ line in the $data-dir/etc/ Here is an example where you expose the user interface to a components directory.


Therefore, if the port is set to 9081, the exposed URL will be http://localhost:9081/components/.

Configuring the Data Directory

You can use  $install-dir/bin/nexus.vmoptions  to define a new location for data you want to preserve. In the configuration file change the values of, and -XX:LogFile to designate an absolute path you prefer to use.The nexus service will look to add the data directory to the absolute path that you configure. For example, to use the absolute path /opt/sonatype-work/nexus3 change the values as follows: