Installing and Configuring SonarQube on Windows
Installing Sonarqube

Step 1: Download and Install Oracle Java 17
Before installing SonarQube, ensure you have Java installed by following these steps:
- Download Oracle Java 17: Visit Oracle’s website and download Oracle Java 17.
- Install Java: Run the downloaded installer and follow the prompts in the installation wizard.
- Set Environment Variable: Configure the
JAVA_HOME
environment variable to point toC:\Program Files\Java\jdk-17\bin
.
Step 2: Download and Install SonarQube
Now, let’s install SonarQube by following these steps:
- Download SonarQube: Download the SonarQube zip file from SonarSource.
- Extract Files: Unzip the contents to
C:\sonarqube-10.4.1.88267
. - Set Environment Variable: Use the Command Prompt to set the
SONAR_JAVA_PATH
environment variable:
set “SONAR_JAVA_PATH=C:\Program Files\Java\jdk-17\bin\java.exe”
Step 3: Start SonarQube
Start SonarQube using the following command in CMD:

Step 4: Access SonarQube Web Interface
- Open a Browser: Launch your web browser and go to
http://localhost:9000
. - Log In: Use the default credentials
admin/admin
to log in. - Change Password: Follow the prompts to update the default password.
Step 5: Install SonarScanner
SonarScanner allows you to analyze your projects for code quality. Here’s how to install it:
- Download SonarScanner: Get the SonarScanner CLI from SonarSource.
- Extract Files: Unzip the contents to a directory, e.g.,
C:\sonar-scanner-5.0.1.3006-windows
.

Step 6: Analyze Your Project
- Open Command Prompt: Launch the Command Prompt.
- Run SonarScanner: Execute the following SonarScanner command:
C:\sonar-scanner-5.0.1.3006-windows\bin\sonar-scanner.bat -D”sonar.projectKey=myproject” -D”sonar.sources=.” -D”sonar.host.url=http://localhost:9000" -D”sonar.login=<your_token_here>”
Step 7: Create and Analyze a Project in SonarQube
- Log in to SonarQube dashboard.
- Navigate to Projects tab > Create Project.

- Set up the project using global settings.

- Analyze your project locally using SonarScanner.
- Provide a token for authentication and execute the SonarScanner command.

