Skip to content
Home SAST Tools SonarQube
SonarQube

SonarQube

Category: SAST
License: Commercial (with Free Community Build)
Suphi Cankurt
Suphi Cankurt
AppSec Enthusiast
Updated February 27, 2026
9 min read
Key Takeaways
  • Used by 7M+ developers at organizations including Snowflake, Deutsche Bank, and Ford
  • Free Community Build covers 20+ languages (including IaC); commercial editions support 35+ with branch analysis and taint tracking
  • Calendar versioning adopted in 2025 — SonarQube Server 2026.1 is the current Long-Term Active (LTA) release
  • AI CodeFix generates LLM-powered fix suggestions; MCP Server integrates with Claude Code, Cursor, and Windsurf
  • SonarQube Cloud free tier: 50k LOC, 5 users, PR analysis across 30 languages

SonarQube is a code quality and security analysis platform built by SonarSource, used by over 7 million developers at organizations including Snowflake, Deutsche Bank, and Ford.

It’s a SAST tool, but unlike most SAST tools that focus purely on security, SonarQube also tracks bugs, code smells, duplication, and maintainability. It covers 35+ languages with over 6,000 built-in rules. (Sometimes misspelled as SonarCube or Sonar Qube.)

SonarSource switched to calendar versioning in 2025. The current Long-Term Active (LTA) release is SonarQube Server 2026.1.

The free tier, now called Community Build (renamed from Community Edition), is on GitHub under LGPL-3.0 with 10,200+ stars. Commercial Server editions add branch analysis, taint tracking, and AI CodeFix.

SonarQube Cloud is the managed SaaS option, with a free tier covering up to 50k lines of code.

What is SonarQube?

SonarQube is an open-platform static analysis tool that scans source code for bugs, security vulnerabilities, and code smells across 35+ programming languages.

Developed by SonarSource, it combines code quality tracking (reliability, maintainability, duplication, test coverage) with security analysis (vulnerability detection, security hotspots, taint analysis in paid editions) in a single dashboard.

Over 7 million developers use it, and the platform has more than 6,000 built-in analysis rules. SonarQube runs as a self-hosted server (SonarQube Server) or as a managed SaaS service (SonarQube Cloud).

The free Community Build supports 20+ languages on a single branch, while commercial editions add multi-branch analysis, PR decoration, and deeper security scanning.

Quality gates let teams set pass/fail thresholds for metrics like coverage, duplication, and vulnerability count, then enforce those thresholds automatically in CI/CD pipelines.

PR decoration shows findings directly on pull requests in GitHub, GitLab, Bitbucket, and Azure DevOps.

35+ Languages, 6,000+ Rules
Covers Java, JavaScript, TypeScript, Python, C#, C++, PHP, Kotlin, Go, Rust, COBOL, Apex, and more. Rules cover security, reliability, maintainability, and code smells.
Quality Gates
Configurable thresholds that pass or fail code on coverage, duplication, reliability, security, and maintainability. Integrated into CI/CD to block releases that don’t meet standards.
AI CodeFix
LLM-powered automated fix suggestions for detected issues. MCP Server integration allows AI coding assistants to access SonarQube findings and generate fixes.

SonarQube project dashboard showing quality gate status, reliability, security, and maintainability ratings

What are SonarQube’s key features?

Security analysis

SonarQube detects security vulnerabilities and security hotspots. OWASP’s Source Code Analysis Tools page lists SonarQube among established SAST tools in the industry.

Paid tiers add taint analysis that traces data flow from user input to dangerous operations for injection detection. The security rules cover OWASP Top 10, CWE Top 25, and SANS Top 25.

SonarQube issues list showing vulnerability details with severity levels and affected code locations

Code quality

Beyond security, SonarQube tracks code reliability (bugs), maintainability (code smells), and test coverage. Technical debt is quantified as estimated remediation time. Duplication detection identifies copy-pasted code across the project.

CI/CD integration

SonarQube integrates with Jenkins, GitHub Actions, GitLab CI, Azure DevOps, and Bitbucket Pipelines. The SonarScanner CLI handles the analysis, while quality gates provide pass/fail decisions for CI/CD gates. PR decoration shows new findings directly on pull requests.

SonarQube quality gate configuration showing pass/fail conditions for code coverage, duplication, and reliability

Which SonarQube edition do you need?

SonarQube Server comes in four tiers. Each adds capabilities on top of the previous one.

Note that the free tier was renamed from “Community Edition” to “Community Build” and its bundled analyzers moved from LGPL-3.0 to the Sonar Source-Available License (SSALv1) in late 2024.

FeatureCommunity BuildDeveloperEnterpriseData Center
PriceFreePaid (per LOC)Paid (per LOC)Paid (per LOC)
LicenseLGPL-3.0 (analyzers: SSALv1)CommercialCommercialCommercial
Languages20+35+35+35+
Branch analysisMain branch onlyYesYesYes
PR decorationNoYesYesYes
Taint analysisNoNoYesYes
OWASP/CWE reportingBasicFullFullFull
Portfolio managementNoNoYesYes
AI CodeFixNoNoYesYes
High availabilityNoNoNoYes

SonarQube Cloud also has a free tier: up to 50,000 lines of code, 5 users, PR analysis, and 30 language support. Above that, Cloud has paid plans priced by LOC.

Community Build works well for single-branch projects. You get quality gates, 6,000+ rules across 20+ languages (including IaC scanning), and the full dashboard.

The catch: no branch analysis. You can only scan your main branch, so there’s no PR-level feedback.

Most teams start with Developer Edition. Branch analysis and PR decoration are what make SonarQube practical for day-to-day development.

Without them, developers don’t see findings until code hits main, which defeats the point of shift-left scanning.

Enterprise Edition adds taint analysis, which traces data from untrusted sources (user input, API calls) through code to dangerous sinks (SQL queries, file operations, command execution). This catches injection vulnerabilities that pattern-matching rules miss.

Enterprise also adds portfolio management for organizations running SonarQube across dozens or hundreds of projects.

Data Center Edition adds high availability and horizontal scaling across a cluster of SonarQube nodes. Most organizations don’t need this unless downtime on their code quality server is unacceptable.

Commercial Server editions are priced per instance based on lines of code analyzed — contact SonarSource for a quote.

AI CodeFix and MCP Server

AI CodeFix uses LLMs to generate fix suggestions for detected issues. When SonarQube flags a vulnerability or code smell, AI CodeFix proposes a specific code change that the developer reviews before merging.

It currently supports Java, JavaScript, TypeScript, Python, C#, and C++, with more languages planned.

Organizations can use a “bring your own model” approach via Azure OpenAI, so code stays within your infrastructure and is never sent to third-party LLM providers. AI CodeFix is available in Enterprise and Data Center editions.

SonarSource also provides an MCP (Model Context Protocol) server that connects AI coding assistants to SonarQube findings.

It runs locally via Docker (or any OCI-compatible runtime like Podman) and works with Claude Code, Cursor, Windsurf, VS Code with GitHub Copilot, Gemini CLI, Kiro, and Zed.

AI agents can pull issues, quality gate status, and hotspots directly into the coding workflow to generate context-aware fixes.

Should you use SonarQube Server or SonarQube Cloud?

SonarQube Cloud (formerly SonarCloud) is the SaaS version hosted by SonarSource. The analysis engine is the same, but the deployment model differs.

SonarQube ServerSonarQube Cloud
HostingSelf-hosted on your infrastructureSonarSource-managed cloud
SetupInstall, configure database, maintainSign up, connect repository
Free tierCommunity Build (unlimited LOC, main branch only)50k LOC, 5 users, PR analysis, 30 languages
Custom pluginsYesNo
Data residencyYour infrastructureSonarSource cloud
MaintenanceYou manage upgrades and backupsSonarSource manages everything

Choose SonarQube Cloud if you want zero infrastructure management and work primarily with GitHub, GitLab, or Bitbucket Cloud repositories. The free tier now covers private repositories (up to 50k LOC), not just open-source projects.

Choose SonarQube Server if you need on-premises control, custom plugins, or compliance requirements that mandate data stays on your infrastructure.

For open-source projects, SonarQube Cloud is free and the most practical choice. Many popular open-source projects display SonarQube Cloud quality badges on their READMEs.

How do you get started with SonarQube?

1
Install SonarQube — Download from sonarqube.org, run with Docker (docker run -p 9000:9000 sonarqube:community), or use SonarCloud for SaaS.
2
Configure SonarScanner — Install the SonarScanner CLI or use build-tool-specific scanners (Maven, Gradle, .NET). Configure sonar-project.properties with your project key and server URL.
3
Run your first analysis — Execute sonar-scanner in your project directory. Results appear in the SonarQube dashboard within seconds to minutes depending on project size.
4
Set up quality gates — Configure pass/fail conditions for coverage, duplication, reliability, security, and maintainability. Connect to your CI/CD pipeline for automated gating.

What are SonarQube’s strengths and limitations?

Where SonarQube excels

Quality gates are the strongest in the market. No other SAST tool has as mature a gating system.

You set pass/fail thresholds for coverage, duplication, reliability, and security, then enforce them in CI/CD. That’s the main reason thousands of organizations adopt SonarQube.

Language coverage is broad. 35+ languages in commercial editions means most polyglot teams can standardize on one tool. Java, JavaScript, TypeScript, Python, C#, C++, Go, PHP, Kotlin, Ruby, Swift, COBOL, Apex, and more all have dedicated rule sets.

The developer feedback loop works well. PR decoration, SonarQube for IDE (formerly SonarLint), and the web dashboard mean developers see findings while coding, during code review, and in the project overview. Everything stays in one ecosystem.

Where SonarQube falls short

Security depth lags dedicated SAST tools. Semgrep, Checkmarx, and Snyk Code all detect more vulnerability types and do deeper inter-procedural and cross-file analysis. SonarQube’s security scanning works as a solid baseline, but security-critical applications benefit from a dedicated SAST tool alongside it.

Community Build is too limited for teams. No branch analysis and no PR decoration in the free tier pushes most teams toward paid editions quickly. Semgrep offers more generous free-tier capabilities for security-focused scanning, including branch and PR scanning at no cost.

Self-hosting adds operational overhead. SonarQube Server requires a database (PostgreSQL, Microsoft SQL Server, or Oracle), Java runtime, and regular upgrades.

For smaller teams, this maintenance burden can outweigh the benefits.

SonarCloud or lighter tools like Semgrep that run directly in CI without a persistent server may be better fits.

How does SonarQube compare to other SAST tools?

I maintain detailed comparison pages for the most common matchups:

When should you use SonarQube?

SonarQube makes the most sense when you want code quality and security analysis in a single platform. If enforcing quality standards across a large codebase with automated gating is the priority, nothing else covers as much ground.

If you’re an individual developer or working on a small open-source project, start with Community Build (free, unlimited LOC on main branch) or SonarQube Cloud’s free tier (50k LOC with PR analysis). Community Build works if you already self-host; Cloud is simpler if you just want to connect a GitHub repo and go.

For teams doing PR-based development, you need at minimum Developer Edition for branch analysis and PR decoration. Without those, developers only see findings after code hits main, which is too late.

SonarQube Cloud’s paid plans also include these features without the self-hosting overhead.

Larger organizations with compliance requirements get the most from Enterprise Edition: taint analysis, portfolio management, and OWASP/CWE reporting cover audit needs. Data Center Edition adds high availability on top of that.

If your focus is purely security vulnerability detection, dedicated SAST tools like Semgrep, Checkmarx, or Snyk Code go deeper. SonarQube’s strength is breadth (quality and security together), not depth in either one alone.

For a comparison of testing approaches, see the guide on SAST vs DAST vs IAST. For a broader view of SAST tools, see the full category page.

Best for
Teams that want unified code quality and security analysis with mature quality gates, PR decoration, and broad language coverage. Especially strong for Java, .NET, and JavaScript/TypeScript teams using CI/CD pipelines.

Frequently Asked Questions

What does SonarQube do?
SonarQube is a static analysis platform that scans source code for bugs, security vulnerabilities, code smells, and duplication across 35+ programming languages. It has over 6,000 built-in rules covering security (OWASP Top 10, CWE Top 25), reliability, and maintainability. Quality gates enforce pass/fail thresholds in CI/CD pipelines, and PR decoration shows findings directly on pull requests. SonarQube is used by over 7 million developers and is available as a self-hosted server or SonarQube Cloud SaaS.
Is SonarQube free?
SonarQube Community Build (formerly Community Edition) is free under LGPL-3.0, covering 20+ languages (including IaC) with quality gates and 6,000+ rules. Note that bundled analyzers use the Sonar Source-Available License (SSALv1) since late 2024. SonarQube Cloud also has a free tier for up to 50k lines of code and 5 users. Paid Server editions (Developer, Enterprise, Data Center) add branch analysis, taint tracking, and 35+ language support.
How does SonarQube compare to Semgrep?
SonarQube focuses on code quality and security together, while Semgrep is more narrowly focused on security-specific pattern matching. SonarQube has a more polished UI and built-in quality gates, but Semgrep offers easier custom rule writing and faster scan times.
SonarQube vs SonarCloud: which should I use?
SonarQube is self-hosted and gives you full control over your infrastructure. SonarCloud is the SaaS version hosted by SonarSource — free for public/open-source projects. Choose SonarCloud if you want zero maintenance overhead and primarily work on cloud-hosted repositories. Choose SonarQube if you need on-premises control, custom plugins, or have data residency requirements.
Can SonarQube run in CI/CD pipelines?
Yes. SonarQube has native integrations for Jenkins, GitHub Actions, GitLab CI, Azure DevOps, and Bitbucket Pipelines. The SonarScanner CLI can be added to virtually any build system. Quality gates can fail builds when code doesn’t meet configured thresholds.
How much does SonarQube cost?
SonarQube Community Build is free. SonarQube Cloud has a free tier (50k LOC, 5 users) with paid plans above that. SonarQube Server commercial editions (Developer, Enterprise, Data Center) are priced per instance based on lines of code analyzed — contact SonarSource for a quote.
What changed in SonarQube 2026?
SonarSource adopted calendar versioning in 2025, so versions now use year-based numbering. SonarQube Server 2026.1 is the current Long-Term Active (LTA) release, adding expanded language support, AI-native IDE integrations, and a sandbox feature for safer updates. The free tier was renamed from Community Edition to Community Build, and bundled analyzers moved to the SSALv1 license.
What is the difference between SonarQube Server and SonarQube Cloud?
SonarQube Server is self-hosted on your infrastructure — you manage the database, upgrades, and backups. SonarQube Cloud (formerly SonarCloud) is the SaaS version managed by SonarSource. Both use the same analysis engine. Cloud offers a free tier (50k LOC, 5 users), zero infrastructure management, and automatic updates. Server gives you on-premises control, custom plugin support, and full data residency.