
Getting Started Guide
How to Use SonarQube
A practical guide to get you up and running with SonarQube. Written by Delv Editorial, Delv Team.
Getting started with SonarQube
In this guide, you will learn how to set up SonarQube and perform your first code analysis. By the end, you will be able to identify bugs, vulnerabilities, and code smells in your projects, ensuring higher code quality.Step 1: Sign up and set up
- Go to the SonarQube website.
- Click on the "Download" button in the top menu.
- Choose the "Community Edition" for free access and download the appropriate package for your operating system.
- Follow the installation instructions provided for your platform (Linux, Windows, etc.).
- Once installed, open your web browser and go to
http://localhost:9000to access the SonarQube dashboard. - The default credentials are username:
adminand password:admin. Change the password when prompted.
Step 2: Your first analysis
- Create a new project by clicking on the "Create Project" button on the dashboard.
- Enter your project key and name, then click "Continue."
- Choose your preferred method for analysis (e.g., using SonarScanner).
- If you select SonarScanner, follow the instructions provided to install it on your machine:
- Navigate to your project directory in the terminal and run the following command:
sonar-scanner -Dsonar.projectKey=your_project_key -Dsonar.sources=.
- After the scan completes, refresh the SonarQube dashboard to view your project's analysis results.
Step 3: Get better results
- Configure quality profiles by clicking on "Quality Profiles" in the top menu. Here, you can set rules for different programming languages.
- Adjust the severity levels for issues by selecting the "Rules" option to focus on the most critical problems.
- Use the "Issues" tab to filter results based on severity, type, or status, helping you prioritise fixes.