How to Install SonarQube 9.9+ as a Windows Service

In the older versions of SonarQube you got a dedicated InstallNTService.bat file to install the Windows Service of SonarQube. This file is no longer shipped with a current SonarQube installation. Instead, we must run SonarService.bat with the install option to run SonarQube as a Windows Service:

To remove the Windows Service, we can use the uninstall option:

If we just want to check if the configuration is correct, we can run the other batch file of SonarQube:

I prefer this approach over the alternative SonarService.bat start because we get all errors right there in the terminal. SonarService may tell us that everything is OK while StartSonar points out that we run a no longer supported OpenJDK version.

Therefore, if something does not work, run StartSonar to check the configuration and use SonarService to install or uninstall the Windows Service.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.