Introduction
The quality of code is important for all developers. But if there are lots of projects and they have lakhs of code lines then it will be difficult to maintain manually. So, we need tools that can analyze the code quality. Yes, there is a tool available for static analysis called "SonarQube". In this article, we are going to explore how to setup the SonarQube on our local machine.
What is SonarQube?
- SonarQube is an open-source platform developed by SonarSource for continuous inspection of code quality.
- It is used to measure the static code analysis and provides a detailed report of bugs, code smells, vulnerabilities, code duplications.
- The SonarQube code quality analysis makes your code clean, more reliable, and more readable.
- It supports 25+ major programming languages through built-in rule sets.
- SonarQube covers the below code quality,
- Coding standards
- Duplicated code
- Unit tests
- Potential bugs
- Complexity
- Comments
How to setup the SonarQube in a local machine?
- We need Docker Desktop for Windows to setup the SonarQube local.
- Download and install Docker Desktop for Windows.
- Open the Powershell and check if the docker is installed or by running the below command.
docker info

- Run the below command to download and install the "SonarQube" image. The command will download and install the "SonarQube" image if not already present in the local image store in your machine and run the container with the "SonarQube" image.
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest

- You can check the image and container in Docker Dashboard.


- Once done with the all above steps, then "SonarQube" is running in http://localhost:9000 now. Launch SonarQube portal in http://localhost:9000.

- The default login credential is admin/admin.













Join the conversation! Your thoughts help the community grow.