Skip to main content

Sonatype Nexus Repository License Management

To access Nexus Repository Pro features you need to install a Pro license. Visit the main Sonatype site for details on pricing and how to purchase a license for Nexus Repository Pro.

License management differs between single-instance and clustered high availability (HA) deployments.

What Happens if My Installed License Expires?

When your license expires, Nexus Repository is disabled except to install a new license or generate a support zip.

Follow the instructions for either of the following:

The Sonatype account team provides the license as a .lic file in an email sent to the primary stakeholders.

Installing and Updating Licenses in a Single-Instance Deployment

This section covers license installation and upgrades in single-instance Nexus Repository deployments. For information on managing licenses in high availability (HA) or resilient deployments, see our help documentation for managing licenses in a clustered environment. Note that managing Nexus Repository licenses requires nx-admin or nx-license privileges.

To install a Nexus Repository Pro license in a single-instance deployment for either the first time or to update an existing license, complete the following steps:

  1. Navigate to Administration (cog icon) → SystemLicensing in the user interface.

  2. Under Install License, select Choose File.

  3. Select the correct .lic file, then select Open.

  4. Select the Upload License button.

  5. Select I Accept to accept the terms stated in the End User License Agreement.

  6. Restart Nexus Repository for the new license to take effect.

After you have restarted Nexus Repository, the License type shown in the Licensing panel will display the features associated with your license.

The licensing API allows you to both install or uninstall a Nexus Repository Pro binary license file. Note that if you are removing a license in a containerized or OpenShift environment, you should use the REST API for removing the license. The REST API method for uninstalling a license deletes the license from wherever Nexus Repository has stored it, ensuring that the old license is truly removed. You may then use either the user interface or API for installing a new one.

The example below shows how to install an initial license:

curl -v -u admin:admin123 -H "Accept: application/json" -H "Content-Type: application/octet-stream" --data-binary @/absolute/path/to/license.lic "{nexusHost}/service/rest/v1/system/license"

To update an expired license, uninstall the license using the licensing API as shown in the example below:

curl -X 'DELETE' \
  'http://{nexusHost}/service/rest/v1/system/license' \
  -H 'accept: application/json' \
  -u {username}:{password}

After uninstalling your old license, install a new one as shown in the first example.

Note that installing a license using a system property will only work on new setups where a license is not yet installed. To install a license using a system property, complete the following steps:

  1. Locate your repository manager installation data directory. By default, the data directory is found at../sonatype-work/nexus3.

  2. Either create a new file or edit the existing file at path $data-dir/etc/nexus.properties.

  3. Add the following property in that file:

    nexus.licenseFile=/absolute/path/to/your/nexus/repository/manager/license.lic

    The referenced license.lic file should be the license file that Sonatype provided you and should be readable by the user owning the repository manager process.

  4. Start Nexus Repository.

The nexus.log will contain a log message indicating success or failure of reading the license file using this method.

Log message indicating the property is being used to load a license file:

2017-10-23 14:40:19,654-0500 INFO [jetty-main-1] *SYSTEM com.sonatype.nexus.licensing.ext.internal.NexusLicenseInstaller -

Installing license from property nexus.licenseFile=/absolute/path/to/your/nexus/repository/manager/license.lic

Log message indicating that a newer or the same license is already installed in the OS user Java preferences location, so the one referenced by the property is being ignored:

2017-10-23 14:40:19,654-0500 INFO [jetty-main-1] *SYSTEM com.sonatype.nexus.licensing.ext.internal.NexusLicenseInstaller -

Ignoring property nexus.licenseFile=/absolute/path/to/your/nexus/repository/manager/license.lic. A license is already installed.

Installing and Updating Licenses in a High Availability or Resilient Deployment

Every Nexus Repository instance in a clustered environment must have a valid license, and making targeted REST API requests to each node may not be possible when using a load balancer.

In Nexus Repository clustered environments before version 3.74.0, updating the license through the user interface would only install the license on the single node; leaving the rest of the cluster with either the old or no license.

Updating a License in Clustered Nexus Repository Deployments (Versions 3.74.0+)

Starting in version 3.74.0, administrators can update an entire Nexus Repository cluster's license by installing a new license on any node using the user interface or REST API. Depending on which deployment pattern used, you will need to update your license according to those instructions.

Nexus Repository will store the license in the database for seven days. Nodes that start during that period will automatically compare their stored license to the newly installed one. If the newly installed license has an expiration date that is later than that node's stored license's expiration, the node will update to the new license instead.

Note that if you are using Kubernetes, you will need to update your external license so that any new nodes created will use the new license.

Uninstalling the license before installing a new one reduces the risk of missing all of the nodes in the cluster.

  1. Uninstall the license using the Licensing REST API

    curl -X 'DELETE' -u {username}:{password} -H 'accept: application/json' \
      'http://{nexusHost}/service/rest/v1/system/license'
    
  2. Repeat the request using the IP address for each node of the cluster.

    We recommend using the IP address of each node when making the API requests as using the domain name does not allow you to target specific nodes depending on your load balancer policy.