Start Free
2025.1 | Instance administration | License administration

License administration

On this page

To run SonarQube Server, you need a license corresponding to the edition and the maximum number of Lines of Code you want to use, including or not commercial support, and including or not staging licences. See the Sonar Plans and Pricing page for more details. 

License management policy

License tied to server ID

The SonarQube license is tied to the server ID which is generated based on the database system (connection string). 

License key invalidation scenarios

Certain actions will regenerate your server ID and invalidate your license key. The following are some of the most common of these actions:

  • 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, please open a support ticket beforehand to confirm the plan or explore alternatives.

When your license is invalidated due to a change of server ID, you can exceptionally extend it to benefit from a grace period of seven days. After this period, the license will remain not valid. Note that you can only do this once. 

In all cases, follow the steps below in Your license key isn't working if your license key has been invalidated.

License notifications

As a System Administrator, you will be notified by email:

  • When your SonarQube Server license is about to expire.
    A reminder is sent two months and again one month before your license expires.
  • When your LOC (Lines of Code) consumption approaches your entitled LOC limit.
    A configurable notification threshold is used to activate the notification. For more information, see Monitoring your LOC consumption.
Staging licences

Staging licenses are only available in Enterprise Editions, Data Center Edition, or with commercial support.

Your license may include one or more staging licenses. You can use these licenses for non-production instances to test new features, upgrades, new integrations, etc.

Our license mechanism supports regular synchronization between your production instance and staging instances.

Requesting a license

Once you have installed your SonarQube Server and your database, you can request a license.

To request a license:

  1. Retrieve your server ID as follows, go to Administration > Configuration > License Manager or to Administration > System. Your server ID is displayed on the page.
  2. Go to the self-managed editions and select either Buy now (for a Developer edition) or Contact sales (otherwise).

Applying your license

Once you have received your license key from Sonar, you can apply it to your SonarQube Server instance:

  1. Go to the Administration > Configuration > License Manager.
  2. Select Set new license, and enter your license key to update or apply a new SonarQube Server license.

Using staging licenses

If your license includes one or more staging licenses, you can use them for non-production instances to test new features, upgrades, new integrations, etc.

Setting up the first staging
  1. Create a staging database and copy the production database into it.
    1. Connect your SonarQube Server staging instance to it.
    2. Start SonarQube Server and retrieve the generated server ID.
    3. Request your staging license key for this server ID.
    4. Set it up in the administration panel.
Synchronizing your staging database

To synchronize your staging database with your production database: 

  1. Empty the staging database and copy the production database into it.
  2. Start SonarQube Server.
  3. The server ID will be the same as generated the first time, so you can reuse the same license key.

Your license key isn't working

If your license key isn't working, send an email to contact@sonarsource.com that includes the following information:

  1. Server ID: Found under System Info at Administration > System.
  2. SonarQube Server version: Found under System Info at Administration > System.
  3. Clarify what current license (production/staging) and server ID this is replacing.
  4. Confirm the status of the existing license.

A new license key will be issued within 1 business day once we receive an email with the needed information at contact@sonarsource.com.


Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved.

Creative Commons License