Post Date: May 15, 2021
Last Updated: December 05, 2026
Introduction
SonarQube Integration in Jenkins helps development teams automate code quality analysis as part of their Continuous Integration and Continuous Delivery (CI/CD) pipeline. By integrating SonarQube with Jenkins, developers can automatically identify bugs, security vulnerabilities, code smells, and other code quality issues whenever changes are committed to the source code repository.
Jenkins is a popular open-source automation server used to build, test, and deploy applications. SonarQube is a code quality and security analysis platform that helps developers maintain clean, reliable, and secure code.
Integrating these two tools allows development teams to detect potential problems early in the software development lifecycle and improve overall application quality.
In this article, we will explain how to integrate SonarQube with Jenkins, configure the required plugins and credentials, and execute code analysis through a Jenkins job.
Prerequisites
Before starting the SonarQube Integration in Jenkins, make sure you have the following requirements:
- Jenkins Server: A working Jenkins installation with administrator access.
- SonarQube Server: An installed and running SonarQube instance accessible from Jenkins.
- Java Environment: A compatible Java version configured according to your SonarQube, scanner, and build tool requirements.
- Jenkins Plugins: SonarQube Scanner for Jenkins and the required Credentials plugin.
- SonarQube Token: A generated authentication token from your SonarQube account.
- Source Code Repository: A project hosted in GitHub, GitLab, Bitbucket, or another supported source control platform.
- Network Connectivity: Jenkins must be able to communicate with the SonarQube server.
Steps for SonarQube Integration in Jenkins
Please find the below steps for integrating sonarqube with Jenkins.
- Log in to Jenkins and install the SonarQube Scanner plugin
Go to Manage Jenkins –> Manage Plugins > Available –> SonarQube scanner - Also add credentials plugins to store your credentials in Jenkins
- Configure SonarQube home path.
a) Go to Manage Jenkins –> Global Tool Configuration –> SonarQube ScannerName : sonar_scanner
b) SONAR_RUNNER_HOME : /opt/sonarqube (Your directory path of SonarQube)

4. Now, Configure SonarQube server in Jenkins. For integration, you need SonarQube Server authentication token in Jenkins
a) Log in into your SonarQube Server and find following under user bar
Go to My Account –> Security –> Generate Token

5. Go to Manage Jenkins –> Configure Systems –> SonarQube Servers
Name : SonarQube
Server URL: Not Required is same as default
Server authentication token :
a) Add server authentication token as following

b) Select it as a server authentication token

6. Save it. Create a job in Jenkins and under “Build” select “execute sonarqube scanner” option and paste the following line.
sonar.projectKey=<Projectkey>
sonar.projectName=<Projectname>
sonar.sources=.
sonar.sourceEncoding=UTF-8
sonar.host.url=https://yourdomainname.com or ipaddress:portnumber/
sonar.login=sonarqubetoken
7. Now, your SonarQube integration is completed with Jenkins. Run the job to test SonarQube and to generate a report of your project.
8. Go to SonarQube and check under Projects; you can see all the data related to your project.
Need Help with SonarQube Integration in Jenkins?
Need help integrating SonarQube with Jenkins, configuring CI/CD pipelines, automating code quality analysis, or managing DevOps infrastructure? Talk to our DevOps experts to discuss your requirements
Conclusion
Integrating SonarQube with Jenkins is an effective way to automate code quality and security analysis within a CI/CD pipeline. By configuring the SonarQube Scanner plugin, authentication credentials, server details, and Jenkins pipeline, development teams can continuously monitor application code quality.
This integration helps identify bugs, vulnerabilities, and code smells early in the development process, reducing potential issues during production deployment.
Implementing SonarQube Integration in Jenkins enables teams to maintain better coding standards, improve application reliability, and build more secure software.
For professional DevOps implementation, CI/CD automation, and infrastructure management services, contact Pheonix Solutions.
FAQs
1. What is SonarQube Integration in Jenkins?
SonarQube Integration in Jenkins connects the Jenkins automation server with SonarQube to perform automated code quality and security analysis during application builds.
2. Why do we need the SonarQube Scanner plugin in Jenkins?
The SonarQube Scanner plugin allows Jenkins to communicate with SonarQube, configure server connections, and execute code analysis through Freestyle jobs and Jenkins pipelines.
3. Is SonarQube integration possible with Jenkins Pipeline?
Yes. You can integrate SonarQube with Jenkins Pipeline using the withSonarQubeEnv step and execute the scanner as part of your CI/CD workflow.
4. What is a SonarQube Quality Gate?
A Quality Gate is a set of conditions used to determine whether a project meets defined code quality requirements. It can help Jenkins decide whether a pipeline should continue or fail.
5. Where can we view SonarQube analysis results?
You can view the analysis results by logging in to your SonarQube dashboard and opening the corresponding project. Jenkins can also display a link to the SonarQube project dashboard.
Official Documentation
SonarQube Official Jenkins Integration Guide.
SonarQube Scanner Jenkins Plugin.
Jenkins Pipeline Steps Documentation
Related Articles
How to Add Choice Parameter in Jenkins Job for Branch Selection
How to Configure the Bitbucket credentials in Jenkins
Talk to our Jenkins & DevOps Experts
SonarQube Integration in Jenkins helps development teams automate code quality analysis, identify security vulnerabilities, detect bugs, and maintain coding standards throughout the CI/CD pipeline. Proper Jenkins and SonarQube integration enables businesses to improve software quality, streamline development workflows, and deliver more reliable applications.
At Pheonix Solutions, our team helps businesses implement DevOps practices, configure Jenkins CI/CD pipelines, integrate code quality and security tools, automate application deployments, and maintain reliable production environments.
We can help you with:
- DevOps and Cloud Services to implement Jenkins CI/CD pipelines, integrate SonarQube, automate build and deployment processes, and manage cloud infrastructure.
- VPS Hosting to provision and configure virtual servers for Jenkins, SonarQube, development environments, and application deployment workloads.
- Dedicated Hosting to provide dedicated server resources for Jenkins automation, SonarQube analysis, CI/CD workloads, and performance-demanding applications.
- Security and Server Maintenance to secure Linux servers, configure firewall rules, manage security updates, troubleshoot infrastructure issues, and maintain server security.
- Software Maintenance and Support to troubleshoot Jenkins pipeline failures, maintain application environments, improve code quality workflows, and support ongoing software operations.
Need help integrating SonarQube with Jenkins, configuring CI/CD pipelines, automating code quality analysis, or managing DevOps infrastructure? Talk to our DevOps experts to discuss your requirements.
