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

Starting SonarQube Community Build Docker container

On this page

Start the SonarQube Community Build container:

  • either from the command line (docker run) or 
  • from a configuration file (docker compose). 

Starting the container by using docker run

Run the image with your database properties defined using the -e environment variable flag:

$> docker run -d --name sonarqube \
    -p 9000:9000 \
    -e SONAR_JDBC_URL=... \
    -e SONAR_JDBC_USERNAME=... \
    -e SONAR_JDBC_PASSWORD=... \
    -v sonarqube_data:/opt/sonarqube/data \
    -v sonarqube_extensions:/opt/sonarqube/extensions \
    -v sonarqube_logs:/opt/sonarqube/logs \
    <image_name>

Note that:

  • By default, the server running within the container will listen on port 9000. The -p 9000:9000 argument is used to expose the container port 9000 to the host port 9000: -p port1:port2 maps container’s port port1 as port2 on the host. 
  • For <image_name>, check the tags currently available on the DockerHub page

Starting the container by using Docker compose

If you're using Docker Compose, use this yml file example as a reference when configuring your .yml file. 

Note that:

  • By default, the server running within the container will listen on port 9000. The following code is used to expose the container port 9000 to the host port 9000 ("port1:port2" maps container’s port port1 as port2 on the host):
ports:

      - "9000:9000"
  • In the image tag, use the tag value corresponding to the SonarQube Community Build version you want to use. Check the SonarQube Community Build image tags currently available on the DockerHub page. For example:
image:  sonarqube:25.6.0.109173-community

Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved.

Creative Commons License