Canarys | IT Services

Blogs

From Zero to SonarQube with Docker Desktop in Under 10 Minutes

Date:
Author:
Share

In this blog I will be showcasing how to easily setup SonarQube server using docker.

Here I will be using docker desktop version with WSL 2 backend.

Firstly, I will be creating a network for sonar, which will be a isolated network and can be used for sonar related services.

Here I will be running- docker network create sonar

Now I will be creating volumes.

These volumes ensure that your data, extensions, and logs persist even if the container is restarted or removed.

docker volume create sonarqube_data

docker volume create sonarqube_extensions

docker volume create sonarqube_logs

Now I am going to run the following command.

docker run `

–network sonar `

-d `

–name sonar `

-e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true `

-v sonarqube_data:/opt/sonarqube/data `

-v sonarqube_extensions:/opt/sonarqube/extensions `

-v sonarqube_logs:/opt/sonarqube/logs `

-p 9000:9000 `

sonarqube:10.4-community

Here is the explanation of the above command.

–network sonar: Connects the container to the sonar network.

-d: Runs the container in detached mode (in the background).

–name sonar: Names the container sonar for easy reference.

-e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true: Disables strict bootstrap checks (useful for non-production setups).

-v sonarqube_data:/opt/sonarqube/data: Mounts a volume to persist SonarQube’s data.

-v sonarqube_extensions:/opt/sonarqube/extensions: Mounts a volume to store plugins and extensions.

-v sonarqube_logs:/opt/sonarqube/logs: Mounts a volume to store logs.

-p 9000:9000: Maps port 9000 of the container to your local machine — access SonarQube at http://localhost:9000.

sonarqube:10.4-community: Specifies the Docker image to use (SonarQube version 10.4, Community Edition).

Once done if you open you docker desktop, you will be able to see the container and the volumes.

To access the SonarQube please click on – http://localhost:9000

Once you click on in, you will be prompted for the username & password.

The default username and password are admin.

Once you click on login, you will be prompted to update your password.

Enter the old password as admin and enter the desired password in new password and click on update.

Once done you are ready with SonarQube server, and you will be redirected to homepage of SonarQube.

We’re a SonarQube Gold Partner. For licensing, demos, or implementation, reach out to devops@ecanarys.com

Canarys is a SonarQube Gold Partner, delivering end-to-end DevOps solutions using Atlassian, GitLab, GitHub, Azure DevOps, Kubernetes, and more serving clients across 30+ cities in India, APAC, and the USA.

Leave a Reply

Your email address will not be published. Required fields are marked *

Reach Us

With Canarys,
Let’s Plan. Grow. Strive. Succeed.