Basic installation

How to install SonarQube Server Developer or Enterprise edition from the ZIP file and perform the basic setup.

Prerequisites

You have:

  • Checked the host requirements. See Server 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 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 General.

  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 connection. Change the parameter values in <sonarqubeHome>/conf/sonar.properties if necessary.

Start the web server

To start SonarQube Server from the console, see From the ZIP file.

To install and start SonarQube Server as a service, see Running 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 Server at the configured address (by default http://localhost:9000). The default system administrator credentials are admin/admin.

Once SonarQube Server UI is up, you can encrypt sensitive properties stored in <sonarqubeHome>/conf/sonar.properties. See Sensitive settings.

Last updated

Was this helpful?