Start Free
SonarQube Community Build | Server installation and setup | From Docker image | Basic installation

Docker installation with basic setup

On this page

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

Prerequisites

You have:

Create volumes to persist data

Creating the following volumes helps prevent the loss of information when updating to a new version or upgrading to a higher edition:

    • sonarqube_data: contains data files, such as Elasticsearch indexes
    • sonarqube_logs: contains SonarQube Server logs about access, web process, CE process, and Elasticsearch
    • sonarqube_extensions: will contain any plugins you install and the Oracle JDBC driver if necessary.

Create the volumes with the following commands: 

$> docker volume create --name sonarqube_data
$> docker volume create --name sonarqube_logs
$> docker volume create --name sonarqube_extensions

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):. To do so, set the system properties (environment variables) related to database access: see Database > General in the list of system properties

Oracle database: add the JDBC driver

Drivers for supported databases (except Oracle) are already provided. If you're using an Oracle database, you need to add the JDBC driver to the sonar_extensions volume. To do this:

 1. Start the SonarQube Server container with the embedded H2 database:

$ docker run --rm \
    -p 9000:9000 \
    -v sonarqube_extensions:/opt/sonarqube/extensions \
    <image_name>

For <image_name>, check the tags currently available on the DockerHub page

2. Exit once SonarQube Server has started properly.

3. Copy the Oracle JDBC driver into sonarqube_extensions/jdbc-driver/oracle.

Check the web server connection parameters

Check the default values in Web server > Web server connection in the list of system properties. Change the respective environment variables if necessary.


Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved.

Creative Commons License