Skip to main content

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 loads JVM arguments from the Java properties file $install-dir/bin/nexus.vmoptions:

Example nexus.vmoptions properties file content


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.* andorg.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 for more information on repository manager logging and the recommended approach for adjusting the logging configuration to meet your needs.

This file should not be modified. A sample of default property values are listed in this file such as the main HTTP connector port and the webapp context path.

Change or add new configuration properties in $data-dir/etc/

The file $data-dir/etc/ is created the first time NXRM is started. If configuration is needed before first start then manually create $data-dir/etc/ and add customizations there.


A directory to put keystores when configuring HTTPS

Configuring Memory

Before changing the default memory settings, review our memory guidelines. Changing any one setting will require adjusting all 3 settings. The -Xms and -Xmx settings must always have the same value.

To change JVM memory

  1. Open $install-dir/bin/nexus.vmoptions in a text editor

  2. Find the lines which configure memory:

    Default memory settings

  3. Edit the values of each settting using the following format. Thesizeis a number and the literal unit letters represent gigabytes (g,G) , megabytes (m,M), or kilobytes (k,K).




  4. Save the file with permission and ownership of the user that will own the repository manager process.

Configuring Java Tool Options

The file $install-dir/bin/nexus.vmoptions specifies java tool arguments, one per line, in Java properties file format.

To edit java options

  1. Open $install-dir/bin/nexus.vmoptions in a text editor

  2. Specify each java option on a new line.

    Make sure the last property is followed by an end of line character or a new blank line. Otherwise the last specified property will not be loaded.

  3. Save the file with permission and ownership of the user that will own the repository manager process.

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 lineapplication-port=8081 in$data-dir/etc/, then edit the number. Here is an example where you would change the port to9081:


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,, -Dkaraf.log 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:

Configuring the Temporary Directory

Repository manager uses the Java virtual machine temporary directory for important runtime files.

The temporary directory is set to be inside of the Nexus Repository data directory at $data-dir/tmp. The advantage is file ownership and permissions can be isolated under a single directory tree.

If you wish to change the default temporary location, keep in mind the following requirements:

  • the tmp directory requires exec permissions by the user owning the repository manager process. Do not use the noexec mount option on Linux for the location that contains the tmp directory. If noexec is set on the tmp directory, repository manager startup will fail with an java.lang.UnsatisfiedLinkError message of failed to map segment from shared object: Operation not permitted . If the repository manager docker image is being used, one may need to adjust the permissions on the host directory that's being mounted as a docker volume to allow execution.

  • do not manipulate any files put into the temp directory, especially when repository manager is running

  • make sure the disk hosting the directory has at least 1GB free space

To Change the Temporary Directory

  1. Open $install-dir/bin/nexus.vmoptions in a text editor

  2. Edit the line which contains The value can either be an absolute path or a path relative to the $install-dir/bin directory.

  3. Save the file with permission and ownership of the user that will own the repository manager process.