Installing SonarQube from the Docker image
SonarQube docker images support running both on the
amd64 architecture and on
arm64-based Apple Silicon.
We recommend using Docker Engine version 20.10 and above.
Follow these steps for your first installation:
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 the embedded H2 database and Elasticsearch indexes
sonarqube_logs: contains SonarQube 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:
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:
a. Start the SonarQube container with the embedded H2 database:
b. Exit once SonarQube has started properly.
c. Copy the Oracle JDBC driver into
Start the SonarQube container:
- either from the command line (docker run) or
- from a configuration file (docker compose).
For docker-based setups, environment variables supersede all parameters that were provided with properties. See Docker environment variables for more details.
There is more information about installing and updating SonarQube plugins inside your Docker volume found on the Install a plugin page.
Run the image with your database properties defined using the
-e environment variable flag:
Unless you intend to delete the database and start new when running your image ,be careful not to use
docker-compose down and, be careful when running commands like
docker system prune or
docker volume prune; regardless if you use an
external: true parameter, your database volumes will not persist beyond the initial startup and shutdown of SonarQube.
If you're using Docker Compose, use the following example as a reference when configuring your
.yml file. Click the heading below to expand the
The example below will use the latest version of the SonarQube Docker image. If want to use the LTS version of SonarQube, you need to update the example with the
sonarqube:lts-community image tag.
Docker Compose .yml file example
© 2008-2023, SonarSource S.A, Switzerland. Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution-NonCommercial 3.0 United States License. SONARQUBE is a trademark of SonarSource SA. All other trademarks and copyrights are the property of their respective owners.