# What is `sonarqube`? `sonarqube` Docker repository stores the official Sonar images for SonarQube Server and SonarQube Community Build. [SonarQube Server](https://www.sonarsource.com/products/sonarqube/) (formerly SonarQube) is an on-premise analysis tool designed to detect quality and security issues in 30+ languages, frameworks, and IaC platforms. The solution also provides fix recommendations leveraging AI with Sonar's AI CodeFix capability. By integrating directly with your CI pipeline or on one of the supported DevOps platforms, your code is checked against an extensive set of rules that cover many attributes of code, such as maintainability, reliability, and security issues on each merge/pull request. [SonarQube Community Build](https://www.sonarsource.com/open-source-editions/sonarqube-community-edition/) (formerly SonarQube Community) is Sonar's self-managed free offering, released on a monthly schedule. It includes the latest core capabilities available in open source, providing essential features such as bug detection, identification of code smells, and basic security issue analysis across 21 programming languages and frameworks. For advanced security analysis, enterprise-grade integrations, and scalability features, the commercial version, SonarQube Server, is available. ## How to use this image Here, you'll find the Docker images for the SonarQube Server (Developer Edition, Enterprise Edition, and Data Center Edition), as well as for SonarQube Community Build. ## Docker Host Requirements Because SonarQube uses an embedded Elasticsearch, make sure that your Docker host configuration complies with the [Elasticsearch production mode requirements](https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-prod-mode) and [File Descriptors configuration](https://www.elastic.co/guide/en/elasticsearch/reference/current/file-descriptors.html). For example, on Linux, you can set the recommended values for the current session by running the following commands as root on the host: ```console sysctl -w vm.max_map_count=524288 sysctl -w fs.file-max=131072 ulimit -n 131072 ulimit -u 8192 ``` ## Demo To quickly run a demo instance, see Using Docker on the [Try Out SonarQube](https://docs.sonarsource.com/sonarqube-server/latest/try-out-sonarqube/) page. When you are ready to move to a more sustainable setup, take some time to read the **Installation** and **Configuration** sections below. ## Installation > **Multi-platform support**: Starting from SonarQube `9.9`, the docker images support running both on `amd64` architecture and `arm64`-based Apple Silicon (M1). For installation instructions, see Installing the Server from the Docker Image on the [Install the Server](https://docs.sonarsource.com/sonarqube-server/latest/setup-and-upgrade/install-the-server/installing-sonarqube-from-docker/) page. To run a cluster with the SonarQube Server Data Center Edition, please refer to Installing SonarQube Server from the Docker Image on the [Install the Server as a Cluster](https://docs.sonarsource.com/sonarqube-server/latest/setup-and-upgrade/install-the-server-as-a-cluster/) page. ### Long-Term Active (LTA) versions [LTA](https://www.sonarsource.com/products/sonarqube/downloads/lta/) refers to the version of SonarQube Server that will stay active for a longer period of time. Currently, `2025.4` is the latest LTA version and should be used when LTA version is preferred. To install the latest LTA, you can pull one of the `2025.4-lta-` tags. ## Configuration ### Port binding By default, the server running within the container will listen on port 9000. You can expose the container port 9000 to the host port 9000 with the `-p 9000:9000` argument to `docker run`, like the command below: ```console docker run --name sonarqube-custom -p 9000:9000 %%IMAGE%%:community ``` You can then browse to `http://localhost:9000` or `http://host-ip:9000` in your web browser to access the web interface. ### Database By default, the image will use an embedded H2 database that is not suited for production. > **Warning:** Only a single instance of SonarQube Server or SonarQube Community Build can connect to a database schema. If you're using a Docker Swarm or Kubernetes, make sure that multiple instances are never running on the same database schema simultaneously. This will cause the SonarQube to behave unpredictably, and data will be corrupted. There is no safeguard, as described on [SONAR-10362](https://jira.sonarsource.com/browse/SONAR-10362). The SonarQube Server Data Center Edition has the same limitation in that only one cluster can connect to one database schema at the same time. Set up a database by following the ["Installing the Database"](https://docs.sonarsource.com/sonarqube-server/latest/setup-and-upgrade/install-the-server/installing-the-database/) section. ### Use volumes We recommend creating volumes for the following directories: - `/opt/sonarqube/data`: data files, such as the embedded H2 database and Elasticsearch indexes - `/opt/sonarqube/logs`: contains SonarQube logs about access, web process, CE process, Elasticsearch logs - `/opt/sonarqube/extensions`: for 3rd party plugins > **Warning:** You cannot use the same volumes on multiple instances of SonarQube. ## Upgrading For upgrade instructions, see Upgrading from the Docker Image on the [Upgrade the Server](https://docs.sonarsource.com/sonarqube-server/latest/server-upgrade-and-maintenance/upgrade/upgrade/) page. ## Advanced configuration ### Customized image In some environments, it may make more sense to prepare a custom image containing your configuration. A `Dockerfile` to achieve this may be as simple as: ```dockerfile FROM %%IMAGE%%:community COPY sonar-custom-plugin-1.0.jar /opt/sonarqube/extensions/ ``` You could then build and try the image with something like: ```console $ docker build --tag=sonarqube-custom . $ docker run -ti sonarqube-custom ``` ### Avoid hard termination The instance will stop gracefully, waiting for any tasks in progress to finish. Waiting for in-progress tasks to finish can take a large amount of time, which the docker does not expect by default when stopping. To avoid having the instance killed by the Docker daemon after 10 seconds, it is best to configure a timeout to stop the container with `--stop-timeout`. For example: ```console docker run --stop-timeout 3600 %%IMAGE%% ``` ## Administration Information about administering your instance of SonarQube Server begins [here](https://docs.sonarsource.com/sonarqube-server/latest/instance-administration/overview/).