<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-run-sonarqube-analysis-locally-with-docker-j6dk7ktun" -->

---
title: How to run SonarQube analysis locally with Docker
description: A step-by-step walkthrough shows how to install SonarQube Community Build via Docker, set up a project, and run static code analysis against a sample ASP.NET...
canonical: https://daily.dev/posts/how-to-run-sonarqube-analysis-locally-with-docker-j6dk7ktun
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to run SonarQube analysis locally with Docker | daily.dev
og:description: A step-by-step walkthrough shows how to install SonarQube Community Build via Docker, set up a project, and run static code analysis against a sample ASP.NET...
og:url: https://daily.dev/posts/how-to-run-sonarqube-analysis-locally-with-docker-j6dk7ktun
og:image: https://api.daily.dev/og/posts/J6DK7ktuN.png
og:image:alt: How to run SonarQube analysis locally with Docker
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to run SonarQube analysis locally with Docker

**[Code4IT](https://daily.dev/sources/code4it)** · 8 min read · 0 upvotes · 0 comments

## Summary

A step-by-step walkthrough shows how to install SonarQube Community Build via Docker, set up a project, and run static code analysis against a sample ASP.NET Core API. It covers pulling the Docker image, logging into the local SonarQube UI, creating a project and token, installing the dotnet-sonarscanner global tool, and running the begin/build/end analysis commands, then viewing results such as an unused logger field in the Issues tab.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.code4it.dev/blog/sonarqube-local-with-docker>

## Questions this post answers

### How do I run SonarQube Community Build locally using Docker?

Run the command docker run --name sonarqube-community -p 9001:9000 sonarqube:community, which pulls the sonarqube:community image and exposes the container's port 9000 on host port 9001. After it finishes loading, access it at localhost:9001 and log in with the default admin/admin credentials, then change the password on first login.

_daily.dev surfaces walkthroughs like this for developers wiring up local code quality checks with Docker._

### What are the dotnet sonarscanner commands needed to run a SonarQube analysis on a .NET project?

Run three steps: dotnet sonarscanner begin with /k for the project key, /d:sonar.host.url, and /d:sonar.token; then dotnet build to compile and generate metadata; then dotnet sonarscanner end with /d:sonar.token to send results to the server. The sonarscanner tool itself is installed globally via dotnet tool install --global dotnet-sonarscanner.

_Developers scripting .NET quality gates can find setup guides like this through daily.dev._

## Similar posts on daily.dev

- [6 Steps for Setting Up a New .NET Project the Right Way](https://daily.dev/posts/6-steps-for-setting-up-a-new-net-project-the-right-way-fjdpiz9bk) · Milan Jovanović · 36 upvotes · 0 comments
- [Detect Production-grade Code Quality Issues in Real-time\!](https://daily.dev/posts/detect-production-grade-code-quality-issues-in-real-time--57jqvlxrc) · Daily Dose of Data Science \| Avi Chawla \| Substack · 1 upvotes · 0 comments
- [Multi-Stage Docker Builds for .NET](https://daily.dev/posts/multi-stage-docker-builds-for-net-6fpi3z9mk) · Medium · 0 upvotes · 0 comments
- [Deploying ASP.NET Core Web API to Azure and Docker](https://daily.dev/posts/deploying-asp-net-core-web-api-to-azure-and-docker-cvbz8psyb) · We Are .NET · 2 upvotes · 0 comments
- [SonarQube for IDE in IntelliJ: The Ultimate Java Developer’s Guide](https://daily.dev/posts/sonarqube-for-ide-in-intellij-the-ultimate-java-developer-s-guide-tofek2kgu) · Foojay.io · 1 upvotes · 1 comments

---

Tags: [#devtools](https://daily.dev/tags/devtools), [#docker](https://daily.dev/tags/docker), [#aspnet](https://daily.dev/tags/aspnet)

[View this post on daily.dev](https://daily.dev/posts/how-to-run-sonarqube-analysis-locally-with-docker-j6dk7ktun)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to run SonarQube analysis locally with Docker","url":"https://daily.dev/posts/how-to-run-sonarqube-analysis-locally-with-docker-j6dk7ktun","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-run-sonarqube-analysis-locally-with-docker-j6dk7ktun"},"datePublished":"2026-10-04T13:05:29.892Z","dateModified":"2026-10-04T13:10:08.652Z","description":"A step-by-step walkthrough shows how to install SonarQube Community Build via Docker, set up a project, and run static code analysis against a sample ASP.NET...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e0db1a591163a355ec3e8a0c7cb3b39a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e0db1a591163a355ec3e8a0c7cb3b39a?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Code4IT","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Code4IT","logo":"https://media.daily.dev/image/upload/s--OaaG4G10--/f_auto,q_auto/v1791119049/logos/code4it?_a=BAMAMicg0","url":"https://daily.dev/sources/code4it"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-run-sonarqube-analysis-locally-with-docker-j6dk7ktun","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"devtools,docker,aspnet","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Code4IT","item":"https://daily.dev/sources/code4it"},{"@type":"ListItem","position":3,"name":"How to run SonarQube analysis locally with Docker"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-run-sonarqube-analysis-locally-with-docker-j6dk7ktun#faq","mainEntity":[{"@type":"Question","name":"How do I run SonarQube Community Build locally using Docker?","acceptedAnswer":{"@type":"Answer","text":"Run the command docker run --name sonarqube-community -p 9001:9000 sonarqube:community, which pulls the sonarqube:community image and exposes the container's port 9000 on host port 9001. After it finishes loading, access it at localhost:9001 and log in with the default admin/admin credentials, then change the password on first login. daily.dev surfaces walkthroughs like this for developers wiring up local code quality checks with Docker."}},{"@type":"Question","name":"What are the dotnet sonarscanner commands needed to run a SonarQube analysis on a .NET project?","acceptedAnswer":{"@type":"Answer","text":"Run three steps: dotnet sonarscanner begin with /k for the project key, /d:sonar.host.url, and /d:sonar.token; then dotnet build to compile and generate metadata; then dotnet sonarscanner end with /d:sonar.token to send results to the server. The sonarscanner tool itself is installed globally via dotnet tool install --global dotnet-sonarscanner. Developers scripting .NET quality gates can find setup guides like this through daily.dev."}}]}
```

