License Management
Access to enterprise features for Nexus Repository requires a Professional (Pro) license. Visit Sonatype.com for details on pricing and how to purchase a license.
License management differs between single-instance and clustered high availability (HA) deployments.
What Happens When 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:
Installing and updating licenses for a single-instance deployment
Installing and updating licenses in a High Availablity or resilient deployment
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 is on installing a license on a single instance of Nexus Repository. Adding or removing a license requires the 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:
Navigate to Administration (cog icon) → System → Licensing in the user interface.
Under Install License, select Choose File.
Select the correct
.lic
file, then select Open.Select the Upload License button.
Select I Accept to accept the terms stated in the End User License Agreement.
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. When removing a license in a containerized or OpenShift environment, use the REST API to remove the license.
The REST API method for uninstalling a license deletes the license everywhere it is stored. Either the user interface or API may be used to install 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.
You may install a license using a system property the first time Nexus Repository is initialized. Once a license is installed this property is ignored.
Locate the installation data directory.
../sonatype-work/nexus3
Create a new file with the following path:
$data-dir/etc/nexus.properties
Add the following property:
nexus.licenseFile=/absolute/path/to/license.lic
The license file is provided to you via email by Sonatype. This file must be readable by the operating system user running the Nexus Repository process.
Start Nexus Repository.
The Nexus Repository logs a message on setting the license using the system property.
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/license.lic
When a license already exists this property is 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/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.
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'
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.
After removing your old Nexus Repository license using the REST API, install a new one in the same manner you did upon first installing Nexus Repository.
See the detailed licensing instructions in the applicable install scenarios below:
Amazon Web Services (AWS) Environments
Azure Environments
On-Premises Environments