Start Free
SonarQube Community Build | Server installation and setup | From ZIP file | Basic installation

ZIP file installation with basic setup

On this page

This page explains how to install SonarQube Community Build from the ZIP file and perform the basic setup. 

Prerequisites

You have:

  • Checked the host requirements. See SonarQube Community Build host requirements.
    In particular, make sure the correct Java version is installed. To check the Java version on your computer, you can use the command line. In Windows, open the Command Prompt and type java -version. In macOS, open Terminal and type the same command. This will display the Java version installed on your system. 
  • Performed the pre-installation checks:

Installed your database (except if you want to install SonarQube for test purposes and want to use the embedded database H2). See Installing the database.

Download the distribution

  1. Download the distribution
  2. Unzip the downloaded ZIP file into the directory you want to use to install your SonarQube (except a directory starting with a digit). The figure below shows this directory. It is called <sonarqubeHome> in this documentation. 

Set access to the database

You must configure the access to your database (except if you want to use SonarQube for test purposes and want to use the embedded database H2):

  1. Open <sonarqubeHome>/conf/sonar.properties.
  2. Set the user credentials required to connect to your database. To do so, uncomment and configure the lines related to:
    • sonar.jdbc.username (JDBC user name)
    • sonar.jdbc.password (JDBC user password)
  3. Specify how to connect to your database. To do so, uncomment and configure the line related to sonar.jdbc.url and corresponding to your database type. For more information, see Database > General in the list of system properties.
  4. Comment out the lines dedicated to the embedded database H2. 
Example for a PostgreSQL database
sonar.jdbc.username=sonarqube
sonar.jdbc.password=mypassword
sonar.jdbc.url=jdbc:postgresql://localhost/sonarqube

Oracle database: add the JDBC driver

If you use an Oracle database, copy the JDBC driver into <sonarqubeHome>/extensions/jdbc-driver/oracle.

Drivers for the other supported databases are already provided. Do not replace the provided drivers; they are the only ones supported.

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 will be easier.

To configure the path to the data and temp directories:

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

Linux
sonar.path.data=/var/sonarqube/data
sonar.path.temp=/var/sonarqube/temp
Windows
sonar.path.data=H:\sonarqube\data
sonar.path.temp=H:\sonarqube\temp

2. Make sure the user launching SonarQube has read and write access to those directories.

Check the web server connection parameters

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

Start the web server

To start SonarQube Community Build from the console, see Starting the server from the ZIP file.

To install and start SonarQube Community Build as a service, see Running SonarQube as a service.

The message "SonarQube is operational" appears in the console output or in the server logs after a successful installation and startup. You can now open SonarQube Community Build at the configured address (by default http://localhost:9000). The default system administrator credentials are admin/admin.


Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved.

Creative Commons License