License administration
Learn how to retrieve, setup, stage and request new SonarQube Server licenses.
To run SonarQube Server, you need a license that corresponds to the plan you had purchased, including SonarQube Server edition, Lines of Code (LOC), staging licenses, commercial support and additional features such as Advanced Security. See Plans and Pricing for more information about the different editions and features.
Contact sales to request the license key or email us at [email protected].
After your purchase is confirmed, you will receive a license key.
Permissions
To manage your licenses and additional features in SonarQube Server you must have the Administer System permission.
To apply the permission to users or groups go to Administration > Security > Global Permissions and select the Administer System check box.
Activating your license
After your purchase is confirmed, you will have to request the license key based on your server ID.

To get your license key based on the server ID:
Go to Administration > System
Click Copy ID information. You will need the server ID when requesting the license.
Email us at [email protected] to request the license key, provide the info you just copied.
To activate your SonarQube Server license:

Go to Administration > Configuration > License Manager
Click Add license button to open a modal.
Enter your license key in the modal and accept the terms and conditions.
Click Set license to confirm.
License invalidation scenarios
Certain actions will change your server ID and invalidate your license. The following are some of the most common cases:
Moving, upgrading, or changing your database server to another host, available with a different IP or DNS name.
Changing the existing database server IP or DNS name.
Changing the database/schema name on the database server.
Restoring the database content from another SonarQube Server instance (except for production/staging synchronization).
Reinstalling SonarQube Server on an empty database.
Using DBCopy or MySQL Migrator to copy your old database into a new one.
If you plan on going through one of these scenarios and you have commercial support, open a support ticket beforehand to confirm the plan of action or to explore alternatives.
When your license is invalidated due to a change of server ID, you can extend it using api/editions/activate_grade_period
api endpoint to benefit from a grace period of seven days. After this period, the license will remain invalid. Note that you can only do this once and the procedure requires the Administer System permission.
SonarQube Server license page
Once your activation has been completed you will see the following information on the SonarQube license page.

Click Set a new license and enter a new license key to replace your current license. Click on the dropdown menu and select Unset license to remove it.
License information:
Edition: This is based on the plan you had purchased (Developer, Enterprise or Data Center).
Type: Type of license, the options are production, test or evaluation.
Expiration date: Displays when the license expires.
Support included: Indicates whether commercial support is included in your license.
Activation method: Displays whether the license was activated online, offline or is based on server ID.
Server ID of your instance.
License usage:
Lines of code (LOC): Shows the number of LOC currently analyzed out of the total allowed by your license.
Notification threshold: Shows the LOC threshold that triggers email notification. A reminder is sent two months and again one month before your license expires. Click the Edit notification threshold to change it. For more information, see Lines of Code for more information.
Additional features: Lists all the extra features your organization has purchased, such as Advanced security. It shows the feature’s name, availability and enablement.
Unsetting a license
To remove the license from the system click on the dropdown menu next to the Set a new license button and select Unset license to remove it.
Staging licenses
Staging licenses are available in Enterprise and Data Center editions, or with editions with commercial support. Your contract may include one or more staging licenses. You can use these licenses for non-production instances to test new features, for update purposes, new integrations, etc.
The process of activating staging licenses is the same as for production. However, you should consider the following:
Setting up staging instance and database
Create a staging database and copy the production database into it.
Connect your SonarQube Server staging instance to the staging database.
Start SonarQube Server and retrieve the generated server ID.
Request your staging license key for this server ID.
Activate the license on the license administration page.
Synchronizing your staging database
To synchronize your staging database with your production database:
Empty the staging database and copy the production database into it.
Start SonarQube Server.
The server ID will be the same as generated the first time, so you can reuse the same license key.
License key isn't working
If your license key isn't working, send an email to [email protected] that includes the following information:
Server ID found under Administration > System.
SonarQube Server version found under Administration > System.
Clarify what current license, production or staging, and server ID it is replacing.
Confirm the status of the existing license.
A new license key will be issued within one business day once we receive an email with the required information at [email protected].
Related pages:
Last updated
Was this helpful?