Please see this page for details on how to install and configure PostgreSQL:
Install PostgreSQL Database
Stop SonarQube:
Create a PostgreSQL database named "sonar" and a user named "sonar":
Add or uncomment and modify the following configuration in the "/opt/sonarqube/conf/sonar.properties" file:
Start SonarQube:
SonarQube will create the PostgreSQL schema:
Note that you might get an error, when starting SonarQube, complaining about a failure executing a migration step.
The issue is that SonarQube is failing to migrate an existing database so you might have to review the migration steps related to the version you want to upgrade.
But you can also see this error if you have already started SonarQube using the embedded database before configuring PostgreSQL,
in this case, if you don't care about this embedded database,
just delete the content of the folders "
temp
" and "
data
" (located under SonarQube installation home folder).
Make sure that SonarQube is not running before deleting the content of these folders.