SonarQubecan be packaged as a WAR then deployed on Tomcat or Jetty.
Note that you must already know how to deploy a web application in the server of your choice. Check the Requirements page to get the list of the supported servers.
The SONAR_HOME will refer below to the path to the directory where the SonarQubedistribution has been unzipped.
Installation steps are:
Note that:
the user who runs Tomcat must have read and write access to the SONAR_HOME_DIR directory (to allow plugin installation from the Web admin console for instance)
| Note that after having upgraded SonarQube, it is required to restart the web server. |
If for any reason, the SONAR_HOME has to change (moving the SonarQubedistribution into another directory, generating the WAR and deploying it on different machines, etc.), you can override SONAR_HOME by setting the SONAR_HOME environment variable to the new path.
You can inject environment variables in the SONAR_HOME/conf/sonar.properties file with the following syntax.
For instance, to inject the JDBC connection string:
sonar.jdbc.url: ${env:SONAR_JDBC_URL}
|
This can be quite valuable to better handle production environments.
A minimum heap size of 512Mb is required. To increase the memory heap size on Tomcat, set the CATALINA_OPTS variable before starting Tomcat:
CATALINA_OPTS="-Xmx1024m -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -XX:MaxPermSize=256m" |
| See also this blog. |