How to setup SonarQube on Windows

Here is my environment:
OS: Windows 10
SonarQube: sonarqube-
JDK: Version jdk-11.0.12
HTTP Server: Apache

I am trying to run SonarQube on my computer but I am not able to.
I have addressed many of the issues.
When I type http://localhost:9001 I see the following:

Here is the screen when I run the StartSonar batch file

  "name" : "sonarqube",
  "cluster_name" : "sonarqube",
  "cluster_uuid" : "IIT8cuODQEm_tHyAzkb-wA",
  "version" : {
    "number" : "7.12.1",
    "build_flavor" : "unknown",
    "build_type" : "unknown",
    "build_hash" : "3186837139b9c6b6d23c3200870651f10d3343b7",
    "build_date" : "2021-04-20T20:56:39.040728659Z",
    "build_snapshot" : false,
    "lucene_version" : "8.8.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  "tagline" : "You Know, for Search"

My Command prompt after running StartSonar batch file is as follows:

jvm 1    | Wrapper (Version 3.2.3)
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | 2021.07.22 20:00:53 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-\var\sonarqube\temp
jvm 1    | 2021.07.22 20:00:53 INFO  app[][] Elasticsearch listening on [HTTP:, TCP:]
jvm 1    | 2021.07.22 20:00:53 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\sonarqube-\elasticsearch]: C:\Program Files\Java\jdk-11.0.12\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly\sonarqube-\var\sonarqube\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dio.netty.allocator.numDirectArenas=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.locale.providers=COMPAT -Des.enforce.bootstrap.checks=true -Xmx512m -Xms512m -XX:MaxDirectMemorySize=256m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\sonarqube-\elasticsearch -Des.path.conf=C:\sonarqube-\var\sonarqube\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
jvm 1    | 2021.07.22 20:00:53 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
jvm 1    | 2021.07.22 20:01:01 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
jvm 1    | 2021.07.22 20:01:01 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [C:\sonarqube-]: C:\Program Files\Java\jdk-11.0.12\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8\sonarqube-\var\sonarqube\temp -XX:-OmitStackTraceInFastThrow --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/ --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -Dhttp.nonProxyHosts=localhost|127.*|[::1] -cp ./lib/sonar-application-;C:\sonarqube-\lib\jdbc\postgresql\postgresql-42.2.19.jar C:\sonarqube-\var\sonarqube\temp\sq-process6922738420692722088properties

When I attempt to access http://localhost:9000 I get:

# This site can’t be reached

localhost refused to connect.


* Checking the connection
* [Checking the proxy and the firewall](chrome-error://chromewebdata/#buttons)


Please help.


Welcome to the community!

How come you’re trying to access port 9001? That’s the port that SonarQube spins up its embedded Elasticsearch on. SonarQube itself is on port 9000.


I was testing to see whether any of the two ports (9000 and 9001) were working.
Do you know what could be wrong?


Okay, that makes sense. It’s time to check your server logs.


Hi Ann

I am now cooking with gas:

The issue was with my database setup.

Best regards


1 Like