From Docker image
Installing SonarQube Server's Data Center Edition (DCE) from Docker image.
Don't start this journey alone! As a DCE subscriber, Sonar will assist with the setup and configuration of your cluster. Get in touch with your account manager to receive appropriate onboarding resources.
Overview
The Data Center Edition allows SonarQube to run in a clustered configuration to make it resilient to failures. When using Docker, the general setup principles remain the same but use Docker-specific terminology and configurations.
The default configuration for the Data Center Edition comprises:
Three application nodes responsible for handling web requests from users (WebServer process) and handling analysis reports (ComputeEngine process)
Three search nodes that host the Elasticsearch process
A reverse proxy / load balancer
A database server (PostgreSQL, Oracle, or Microsoft SQL Server)
Important considerations
You should install SonarQube Server DCE on a single Docker host only for test purposes. Sonar recommends running the database, application, and search containers on different Docker hosts for production workloads.
Requirements
Network
All containers should be in the same network. This includes search and application nodes. For the best performance, check for low latency between the database and the cluster nodes.
Container limits
The limits of each container depend on the workload that each container has. A good starting point is:
cpus: 0.5mem_limit: 4096Mmem_reservation: 4096M
The 4 GB mem_limit is the minimum value for Elasticsearch and shouldn't be lower.
Scalability
Application nodes can be scaled using replicas. This isn't the case for the search nodes, as Elasticsearch won't become ready.
Volumes
You'll use the following volumes in your configuration:
sonarqube_data— volumes are shared between replicas in the application nodes, so you don't need asonarqube_datavolume on your application nodes. In the search nodes, thesonarqube_datavolume contains the Elasticsearch data and helps reduce startup time, so Sonar recommends having asonarqube_datavolume on each search node. It should be mounted at/opt/sonarqube/data.sonarqube_extensions— for application nodes, Sonar recommends sharing a commonsonarqube_extensionsvolume which contains any plugins you install and the Oracle JDBC driver if necessary. It should be mounted at/opt/sonarqube/extensions.sonarqube_temp— for application and search nodes, Sonar suggests using asonarqube_tempvolume (mounted at/opt/sonarqube/temp) that collects temporary files outputted by SonarQube. Sonar recommends having asonarqube_tempvolume on each search node.sonarqube_logs— for both application and search nodes, Sonar recommends sharing a commonsonarqube_logsvolume which contains SonarQube logs. It should be mounted at/opt/sonarqube/logs. The volume is populated with a new folder depending on the container's hostname and all logs of that container are put into that folder. This behavior also happens when a custom log path is specified via environment variables. Sonar recommends having asonarqube_logsvolume on each search node.
Database server
Supported database systems are available on the Installing database page.
Load balancer
The installing organization must supply the load balancer. The general requirements are:
Ability to balance HTTP requests (load) between the application nodes configured in the cluster
If terminating HTTPS, meets the requirements set out in the operating documentation
No requirement to preserve or sticky sessions; this is handled by the built-in JWT mechanism
Ability to check for node health for routing
License
You need a dedicated license to activate the Data Center Edition. If you don't have one yet, contact the Sonar Sales Team.
Docker Compose configuration
If you're using Docker Compose, use this yml file example as a reference for evaluation purposes.
To use the 2026 LTA version of SonarQube, for example, change the following image tags in the yml file example:
sonarqube:datacenter-apptosonarqube:2026-lta-datacenter-appsonarqube:datacenter-searchtosonarqube:2026-lta-datacenter-search
Key configuration elements
When configuring your Docker Compose file, ensure you include the following.
For application nodes:
Use the appropriate Data Center Edition application image (for example,
sonarqube:datacenter-appfor the latest release)Mount the shared
sonarqube_extensionsandsonarqube_logsvolumesConfigure database connection via environment variables (
SONAR_JDBC_URL,SONAR_JDBC_USERNAME,SONAR_JDBC_PASSWORD)Set cluster-related environment variables
Configure the JWT secret for session management (
SONAR_AUTH_JWTBASE64HS256SECRET)
For search nodes:
Use the appropriate Data Center Edition search image (for example,
sonarqube:datacenter-searchfor the latest release)Mount individual
sonarqube_datavolumes for each search nodeMount the shared
sonarqube_logsvolumeConfigure cluster-related environment variables for Elasticsearch communication
Installing using Docker Compose
In the folder where your
docker-compose.ymlis stored, rundocker-compose up -d.To check the health of all nodes, run
docker-compose ps.Verify the installation:
Access SonarQube through the load balancer.
Check that all nodes appear healthy on the System Info page.
Apply your Data Center Edition license.
Environment variables
The following environment variables are commonly used in DCE Docker deployments.
Database connection
SONAR_JDBC_URL— JDBC URL for the database connectionSONAR_JDBC_USERNAME— database usernameSONAR_JDBC_PASSWORD— database password
Web server
SONAR_WEB_HOST— web server host (default:0.0.0.0)SONAR_WEB_PORT— web server port (default:9000)SONAR_WEB_CONTEXT— web context path
Cluster configuration
SONAR_CLUSTER_ENABLED— enable cluster mode (true/false)SONAR_CLUSTER_NODE_TYPE— node type (applicationorsearch)SONAR_CLUSTER_HOSTS— comma-separated list of application node hostsSONAR_CLUSTER_SEARCH_HOSTSandSONAR_CLUSTER_ES_HOSTS— comma-separated list of search node hostsSONAR_CLUSTER_NODE_NAME— name of the search nodeSONAR_CLUSTER_KUBERNETES— set totrueto enable application node autodiscoverySONAR_AUTH_JWTBASE64HS256SECRET— JWT secret for session management
Limitations
IPv6 isn't officially supported for the Docker images of the Data Center Edition.
Search nodes can't be scaled using Docker replicas due to Elasticsearch requirements.
Production deployments should use separate Docker hosts for database, application, and search containers.
Related pages
Configuring network security features:
Last updated
Was this helpful?

