Start Free
SonarQube Community Build | Server installation and setup | Installing from ZIP file

Installing SonarQube Community Build from the ZIP file

On this page

First, check the requirements (in particular, make sure the correct Java version 17 or Java version 21 is installed) and perform the pre-installation steps (on a Linux, Unix-based, or macOS system). Then follow these steps for your installation:

Download the distribution

Download and unzip the distribution (do not unzip into a directory starting with a digit).

<sonarqubeHome> (below) refers to the path of the directory where the SonarQube Community Build's distribution has been unzipped.

Perform various settings

Set access to the database

Edit <sonarqubeHome>/conf/sonar.properties to configure the database settings. Templates are available for every supported database. Just uncomment and configure the template you need and comment out the lines dedicated to H2:

Example for PostgreSQL
sonar.jdbc.username=sonarqube
sonar.jdbc.password=mypassword
sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube

For more information, see Environment variables.

Add the JDBC driver

Drivers for the supported databases (except Oracle) are already provided. Do not replace the provided drivers; they are the only ones supported.

For Oracle, copy the JDBC driver into <sonarqubeHome>/extensions/jdbc-driver/oracle.

Change the web server connection parameters

Check the default values of the web server connection parameters. Change the parameter values in  <sonarqubeHome>/conf/sonar.properties if necessary.

Property Description
sonar.web.host

For servers with more than one IP address, this property specifies which address will be used for listening on the specified ports. 

Default value: 0.0.0.0 (ports will be used on all IP addresses associated with the server)

sonar.web.port

TCP port for incoming HTTP connections.

Default value: 9000

sonar.web.context

Web context specifying the path at which to serve SonarQube Server. For example, with sonar.web.port=9000 and sonar.web.context=/sonarqube, you will access the web interface at http://localhost:9000/sonarqube.

Example: /sonarqube (must start with a forward slash)

Default value: empty (root context)

Configure the Elasticsearch storage path

By default, Elasticsearch data is stored in <sonarqubeHome>/data, but this is not recommended for production instances. Instead, you should store this data elsewhere, ideally in a dedicated volume with fast I/O. In addition to maintaining performance, upgrading your instance of SonarQube Community Build will be easier.

Edit <sonarqubeHome>/conf/sonar.properties to configure the following settings:

sonar.path.data=/var/sonarqube/data
sonar.path.temp=/var/sonarqube/temp

The user launching SonarQube Community Buildr must have read and write access to those directories.

Enabling IPv6

  1. Enable IPv6 in the JVM by setting the JAVA_TOOL_OPTIONS environment variable to -Djava.net.preferIPv6Addresses=true.
  2. Enable IPv6 in SonarQube Community Build by setting the sonar.web.javaAdditionalOpts property to -Djava.net.preferIPv6Addresses=true in the SonarQube Community Build configuration file (<sonarQubeHome>/conf/sonar.properties).

Adjusting the Java executable path

By default, the scripts will use the Java executable available in the PATH. If multiple versions of Java are installed on your server, you may need to explicitly define which version is used.

It is possible to overwrite the default Java executable by setting the environmental variable SONAR_JAVA_PATH.

Linux

export SONAR_JAVA_PATH="path/to/java_home/bin/java"

Windows

setx SONAR_JAVA_PATH "C:\Program Files\java_home\bin\java.exe"

Start the web server

  1. Execute the following script to start the server:
    • On Linux: <sonarqubeHome>/bin/linux-x86-64/sonar.sh start
    • On macOS: <sonarqubeHome>/bin/macosx-universal-64/sonar.sh start
    • On Windows: <sonarqubeHome>\bin\windows-x86-64\StartSonar.bat
  2. You can now open SonarQube Community Build at http://localhost:9000 (the default system administrator credentials are admin/admin).
  3. Once your server is installed and running, you're ready to begin analyzing source code.

Post-installation steps

You can encrypt sensitive properties stored in <sonarqubeHome>/conf/sonar.properties. See Encrypting sensitive settings.


Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License