SonarQube Up and Running

SonarQube 3.6.3 + Maven 2.0.11 + PostgreSQL

PostgreSQL Setup

STEP 1: Make sure postgres binaries  are available in your PATH.


STEP 2: Initialize postgres db, execute the following command

initdb -D datapath


STEP 3: Start the database, execute the following command

pg_ctl start -l “E:\logs\postgres\sonar.log” -D “E:\data\postgres\sonar”


STEP 4: Verify that postgres is listening on the default port (5432)

netstat -aon | findstr


STEP 5: Set up the sonar database

Create user postgres, and database sonar, by  executing the following command

createuser -s -r postgres

createdb sonar


connect to sonar databaseas, by  executing the following command

psql sonar


Create user sonar and grant all the permissions, as sonar will create tables/indexes/constraints for you, by  executing the following command

create user sonar with password ‘sonar’;

grant all on database sonar to sonar;


Download SonarQube

Download SonarQube 3.6.3, Version 3.6.3 is compatible with Maven 2.0.11


Configure SonarQube

STEP 1: disable the default H2 database by commenting the line number 48 of SONAR_HOME/conf/


STEP 2: Enable postgres database by un commenting the line number 86 of SONAR_HOME/conf/


Start SonarQube

Goto SONAR_HOME/bin, and based on the OS, go to the corresponding subdirectory, in my case it is windows-x86-64, so the full path would be SONAR_HOME/bin/ windows-x86-64

Double click on StartSonar.bat


First time you would see lots of output, as it will create tables/indexes/constraints etc.

and finally you will see something like this, as you can see that the application has started on port 9000


If you list out all tables in the current database, by executing \dt command in psql, you will get something like this


Point your browser to http://localhost:9000/


SonarQube is up and running now.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s