title: Configuration of Sonarqube with postgresql
body: <p>I'm struggling to install sonarqube (v7.6) using postgresql as database.
  I have followed the instructions of the sonar website :
  <a href="https://docs.sonarqube.org/latest/setup/install-server/" rel="noreferrer">https://docs.sonarqube.org/latest/setup/install-server/</a></p>
  
  <p>But I'm stuck with this vague error :</p>
  
  <pre><code>sh /opt/sonarqube/bin/linux-x86-64/sonar.sh console
  Running SonarQube...
  wrapper | --&gt; Wrapper Started as Console
  wrapper | Launching a JVM...
  jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
  jvm 1 | 
  jvm 1 | 2019.02.12 07:18:55 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
  jvm 1 | 2019.02.12 07:18:55 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
  jvm 1 | 2019.02.12 07:18:55 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch -Epath.conf=/opt/sonarqube/temp/conf/es
  jvm 1 | 2019.02.12 07:18:56 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
  jvm 1 | 2019.02.12 07:18:56 INFO app[][o.e.p.PluginsService] no modules loaded
  jvm 1 | 2019.02.12 07:18:56 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
  jvm 1 | 2019.02.12 07:19:10 INFO app[][o.s.a.SchedulerImpl] Process[es] is up
  jvm 1 | 2019.02.12 07:19:10 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [/opt/sonarqube]: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/opt/sonarqube/temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*:/opt/sonarqube/lib/jdbc/postgresql/postgresql-42.2.5.jar org.sonar.server.app.WebServer /opt/sonarqube/temp/sq-process7062216312618470165properties
  jvm 1 | 2019.02.12 07:19:19 INFO app[][o.s.a.SchedulerImpl] Process [web] is stopped
  jvm 1 | 2019.02.12 07:19:19 INFO app[][o.s.a.SchedulerImpl] Process [es] is stopped
  jvm 1 | 2019.02.12 07:19:19 WARN app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 143
  jvm 1 | 2019.02.12 07:19:19 INFO app[][o.s.a.SchedulerImpl] SonarQube is stopped
  wrapper | &lt;-- Wrapper Stopped
  </code></pre>
  
  <p>Here is my installation procedure :</p>
  
  <pre><code># System config :
  sysctl -w vm.max_map_count=262144
  ulimit -n 65536
  
  # Postgresql install (v9.6.10)
  apt-get install -y postgresql
  su - postgres
  psql
  CREATE USER sonar ;
  ALTER USER sonar WITH PASSWORD 'PASSWORD';
  CREATE DATABASE sonardb WITH ENCODING 'UTF8';
  ALTER DATABASE sonardb OWNER TO sonar;
  ALTER USER sonar SET search_path TO sonardb;
  
  # Sonar install
  apt-get install -y unzip
  wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-7.6.zip
  unzip sonarqube-7.6.zip
  mv sonarqube-7.6 /opt/sonarqube
  
  # Add sonar user
  adduser sonar
  chown -R sonar /opt/sonarqube
  </code></pre>
  
  <p>And finally add the postgresql conf in /opt/sonarqube/conf/sonar.properties :</p>
  
  <pre><code>sonar.jdbc.username=sonar
  sonar.jdbc.password=PASSWORD
  sonar.jdbc.url=jdbc:postgresql://localhost:5432/sonardb
  </code></pre>
  
  <p>I have tried a lot of different setups. But I'm always ending with the same error. I assume that the problem comes from my postgresql setup because the default H2 database works fine.
  I think my error is pretty dumb, but I can't figure it out.</p>
  
  <p>Can someone point out my mistake?</p>