{"id":29864,"date":"2026-12-06T22:06:15","date_gmt":"2026-12-06T22:06:15","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=29864"},"modified":"2026-12-06T22:06:15","modified_gmt":"2026-12-06T22:06:15","slug":"how-to-migrate-sonarqube-from-h2-to-postgresql","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-migrate-sonarqube-from-h2-to-postgresql\/","title":{"rendered":"How to Migrate Sonarqube from H2 to Postgresql?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This page shows how to move SonarQube off its embedded H2 database and onto PostgreSQL: run PostgreSQL in Docker, point <code>sonar.properties<\/code> at it, set the kernel limits that Elasticsearch needs, then start SonarQube and check that it works. SonarQube has no supported tool for copying H2 data into PostgreSQL, so in practice you switch to a fresh PostgreSQL database and re-analyse your projects. The sections below the original steps cover what you can keep, safer commands and how to fix the usual errors.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1 &#8211; Run Postgresql using docker command<\/h2>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres<\/code><\/span><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2 &#8211; Modify sonar.properties<\/h2>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">sonar.jdbc.username=postgres\r\nsonar.jdbc.password=mysecretpassword\r\nsonar.jdbc.url=jdbc:postgresql:<span class=\"hljs-comment\">\/\/172.31.13.0:5432\/postgres?currentSchema=public<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3 &#8211; Do this<\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devopsschool-com wp-block-embed-devopsschool-com\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"gomg7XiWHO\"><a href=\"https:\/\/www.devopsschool.com\/blog\/elastic-search-error-max-virtual-memory-areas-vm-max_map_count-65530-is-too-low-increase-to-at-least-262144\/\">Elastic Search Error &#8211; max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Elastic Search Error &#8211; max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]&#8221; &#8212; \" src=\"https:\/\/www.devopsschool.com\/blog\/elastic-search-error-max-virtual-memory-areas-vm-max_map_count-65530-is-too-low-increase-to-at-least-262144\/embed\/#?secret=SWyP6fEYVd#?secret=gomg7XiWHO\" data-secret=\"gomg7XiWHO\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4 &#8211; Do this<\/h2>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-devopsschool-com wp-block-embed-devopsschool-com\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"RwAvMMCfc2\"><a href=\"https:\/\/www.devopsschool.com\/blog\/elastic-search-error-max-file-descriptors-4096-for-elasticsearch-process-is-too-low-increase-to-at-least-65535\/\">Elastic Search Error &#8211; max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Elastic Search Error &#8211; max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]&#8221; &#8212; \" src=\"https:\/\/www.devopsschool.com\/blog\/elastic-search-error-max-file-descriptors-4096-for-elasticsearch-process-is-too-low-increase-to-at-least-65535\/embed\/#?secret=tP5s9j7EoW#?secret=RwAvMMCfc2\" data-secret=\"RwAvMMCfc2\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5 &#8211; Start SonarQube<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">Step 6 &#8211; Access http:\/\/52.66.187.172:9000\/<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">admin<br>admin<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">What this migration really does<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The embedded H2 database is for evaluation only. It cannot be upgraded to newer SonarQube versions and is not supported in production. SonarQube does not provide a tool that exports H2 data and imports it into PostgreSQL. When you change <code>sonar.jdbc.url<\/code> as in the steps above, SonarQube finds an empty database, creates a new schema and starts with no data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Plan for these results: projects, analysis history, issues and their comments, users, tokens and permissions all start over. Your code and CI pipelines stay the same. Once the pipelines run again against the new server, current measurements and issues come back. Old history does not.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> Keep the old <code>$SONARQUBE_HOME\/data<\/code> directory, which holds the H2 files, until the new setup is confirmed. To roll back, stop SonarQube, comment out the <code>sonar.jdbc.*<\/code> lines and start it again.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Save what you can before switching<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Some configuration can be exported from the H2 instance before you shut it down. Do this first.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Item<\/th><th>How to carry it over<\/th><\/tr><\/thead><tbody><tr><td>Custom quality profiles<\/td><td><strong>Quality Profiles<\/strong> &gt; profile menu &gt; <strong>Back Up<\/strong> saves an XML file. On the new instance use <strong>Restore<\/strong>. The <code>api\/qualityprofiles\/backup<\/code> and <code>api\/qualityprofiles\/restore<\/code> Web API endpoints do the same thing.<\/td><\/tr><tr><td>Quality gates<\/td><td>There is no built-in export. Note the conditions and recreate them in the UI or through the <code>api\/qualitygates<\/code> Web API.<\/td><\/tr><tr><td>Global settings and webhooks<\/td><td>Copy them from <strong>Administration<\/strong> and set them again by hand.<\/td><\/tr><tr><td>Users, groups, permissions<\/td><td>Recreate them, or connect LDAP, SAML or another identity provider so users are provisioned again.<\/td><\/tr><tr><td>Analysis tokens<\/td><td>Generate new tokens and update the secrets in your CI tools.<\/td><\/tr><tr><td>Project history<\/td><td>Cannot be migrated. Re-run analysis for each project.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Run PostgreSQL with persistent storage (improved Step 1)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The command in Step 1 uses the <code>postgres<\/code> superuser and the default <code>postgres<\/code> database. It also has no volume, so all SonarQube data is lost if the container is removed. The version below pins the image tag, stores data in a named volume and only publishes the port on localhost. Before you pick a tag, check that the PostgreSQL major version is listed as supported in the SonarQube requirements for your version.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">docker run -d --name sonar-postgres \\\n  --restart unless-stopped \\\n  -p <span class=\"hljs-number\">127.0<\/span><span class=\"hljs-number\">.0<\/span><span class=\"hljs-number\">.1<\/span>:<span class=\"hljs-number\">5432<\/span>:<span class=\"hljs-number\">5432<\/span> \\\n  -e POSTGRES_PASSWORD=<span class=\"hljs-string\">'Admin-Pa55-change-me'<\/span> \\\n  -v sonar_pgdata:<span class=\"hljs-regexp\">\/var\/<\/span>lib\/postgresql\/data \\\n  <span class=\"hljs-attr\">postgres<\/span>:<span class=\"hljs-number\">16<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Next, create a dedicated user and a UTF-8 database owned by that user. SonarQube requires UTF-8. Making <code>sonar<\/code> the owner of the database also gives it the <code>CREATE<\/code> rights on the <code>public<\/code> schema that PostgreSQL 15 and later no longer grant to everyone by default.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">docker exec -it sonar-postgres psql -U postgres \\\n  -c <span class=\"hljs-string\">\"CREATE USER sonar WITH ENCRYPTED PASSWORD 'Sonar-Pa55-change-me';\"<\/span> \\\n  -c <span class=\"hljs-string\">\"CREATE DATABASE sonarqube OWNER sonar ENCODING 'UTF8';\"<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> If SonarQube runs on a different host, publish the port on a private interface (for example <code>-p 5432:5432<\/code>) and use a firewall or security group so that only the SonarQube server can reach port 5432. Do not expose PostgreSQL to the internet. Newer <code>postgres<\/code> images change the default data path, so read the image documentation before changing the tag or the volume mount.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Point SonarQube at PostgreSQL (improved Step 2)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Edit <code>$SONARQUBE_HOME\/conf\/sonar.properties<\/code>. Use the address where PostgreSQL can actually be reached. If both run on the same host and the port is published as shown above, that address is <code>127.0.0.1<\/code>. Hard-coding a private cloud IP such as the one in Step 2 breaks when the instance is replaced. <code>currentSchema=public<\/code> is the default, so you can leave it out.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">sonar.jdbc.username=sonar\nsonar.jdbc.password=Sonar-Pa55-change-me\nsonar.jdbc.url=jdbc:postgresql:<span class=\"hljs-comment\">\/\/127.0.0.1:5432\/sonarqube<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">If you prefer to keep the password out of the file, set the equivalent environment variables for the service. When both are set, the environment variables take precedence over <code>sonar.properties<\/code>. They are also how the official SonarQube Docker image is configured.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\"><span class=\"hljs-keyword\">export<\/span> SONAR_JDBC_URL=jdbc:postgresql:<span class=\"hljs-comment\">\/\/127.0.0.1:5432\/sonarqube<\/span>\n<span class=\"hljs-keyword\">export<\/span> SONAR_JDBC_USERNAME=sonar\n<span class=\"hljs-keyword\">export<\/span> SONAR_JDBC_PASSWORD=<span class=\"hljs-string\">'Sonar-Pa55-change-me'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Stop SonarQube before you edit anything. Also delete the Elasticsearch data directory (<code>$SONARQUBE_HOME\/data\/es7<\/code> or <code>data\/es8<\/code>, depending on the version) so that the search indexes are rebuilt from the new database and not from leftover H2 data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Kernel and process limits (what Steps 3 and 4 mean)<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SonarQube includes Elasticsearch, which will not start unless the host meets minimum limits. The pages linked in Steps 3 and 4 explain the Elasticsearch errors. Current SonarQube documentation sets higher minimums than those error messages show: <code>vm.max_map_count<\/code> of at least 524288, <code>fs.file-max<\/code> of at least 131072, at least 131072 open files and at least 8192 threads for the user that runs SonarQube.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Apply now<\/span>\nsudo sysctl -w vm.max_map_count=<span class=\"hljs-number\">524288<\/span>\nsudo sysctl -w fs.file-max=<span class=\"hljs-number\">131072<\/span>\n\n<span class=\"hljs-comment\"># Persist across reboots<\/span>\ncat &lt;&lt;<span class=\"hljs-string\">'EOF'<\/span> | sudo tee \/etc\/sysctl.d\/<span class=\"hljs-number\">99<\/span>-sonarqube.conf\nvm.max_map_count=<span class=\"hljs-number\">524288<\/span>\nfs.file-max=<span class=\"hljs-number\">131072<\/span>\nEOF\n\n<span class=\"hljs-comment\"># Per-user limits for the account that runs SonarQube<\/span>\ncat &lt;&lt;<span class=\"hljs-string\">'EOF'<\/span> | sudo tee \/etc\/security\/limits.d\/<span class=\"hljs-number\">99<\/span>-sonarqube.conf\nsonarqube   -   nofile   <span class=\"hljs-number\">131072<\/span>\nsonarqube   -   nproc    <span class=\"hljs-number\">8192<\/span>\nEOF<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> If SonarQube runs as a systemd service, <code>limits.d<\/code> does not apply. Put <code>LimitNOFILE=131072<\/code> and <code>LimitNPROC=8192<\/code> in the <code>[Service]<\/code> section of the unit file, then run <code>systemctl daemon-reload<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Start SonarQube and verify (Steps 5 and 6 in detail)<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Start SonarQube as a non-root user. Elasticsearch refuses to run as root: <code>sudo -u sonarqube \/opt\/sonarqube\/bin\/linux-x86-64\/sonar.sh start<\/code><\/li>\n\n\n<li>Watch the logs while the schema is created: <code>tail -f \/opt\/sonarqube\/logs\/sonar.log \/opt\/sonarqube\/logs\/web.log<\/code><\/li>\n\n\n<li>Check the status. It shows <code>STARTING<\/code> while the schema is being created, then <code>UP<\/code>: <code>curl -s http:\/\/localhost:9000\/api\/system\/status<\/code><\/li>\n\n\n<li>Confirm that the tables were created in PostgreSQL: <code>docker exec -it sonar-postgres psql -U sonar -d sonarqube -c &#039;\\dt&#039;<\/code><\/li>\n\n\n<li>Open <code>http:\/\/&lt;server-ip&gt;:9000<\/code>, log in with <code>admin<\/code> \/ <code>admin<\/code> and set a new password when prompted.<\/li>\n\n\n<li>Check that the embedded-database warning no longer appears in the UI and that <strong>Administration &gt; System<\/strong> shows PostgreSQL as the database.<\/li>\n\n\n<li>Restore the quality profiles, recreate quality gates and tokens, then re-run your CI analyses.<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">$ curl -s http:<span class=\"hljs-comment\">\/\/localhost:9000\/api\/system\/status<\/span>\n{<span class=\"hljs-string\">\"id\"<\/span>:<span class=\"hljs-string\">\"...\"<\/span>,<span class=\"hljs-string\">\"version\"<\/span>:<span class=\"hljs-string\">\"...\"<\/span>,<span class=\"hljs-string\">\"status\"<\/span>:<span class=\"hljs-string\">\"UP\"<\/span>}<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Common errors and fixes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Symptom (log file)<\/th><th>Cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td><code>Connection refused<\/code> (web.log)<\/td><td>Wrong host or port, the container is not running, or a firewall is blocking the connection<\/td><td>Run <code>docker ps<\/code>, check the JDBC host, and test with <code>pg_isready -h &lt;host&gt; -p 5432<\/code><\/td><\/tr><tr><td><code>password authentication failed for user<\/code> (web.log)<\/td><td>Wrong credentials in <code>sonar.properties<\/code> or environment variables<\/td><td>Reset the password with <code>ALTER USER sonar WITH PASSWORD &#039;...&#039;<\/code> and update the config<\/td><\/tr><tr><td><code>permission denied for schema public<\/code> (web.log)<\/td><td>PostgreSQL 15 or later, and the user does not own the database<\/td><td><code>ALTER DATABASE sonarqube OWNER TO sonar;<\/code> or <code>GRANT ALL ON SCHEMA public TO sonar;<\/code><\/td><\/tr><tr><td><code>max virtual memory areas vm.max_map_count [65530] is too low<\/code> (es.log)<\/td><td>Kernel limit is not set<\/td><td>Set <code>vm.max_map_count=524288<\/code> as shown above<\/td><\/tr><tr><td><code>max file descriptors [4096] ... is too low<\/code> (es.log)<\/td><td>nofile limit is not applied to the service user<\/td><td>Fix <code>limits.d<\/code> or the systemd <code>LimitNOFILE<\/code> setting<\/td><\/tr><tr><td><code>can not run elasticsearch as root<\/code> (es.log)<\/td><td>SonarQube was started as root<\/td><td>Create a <code>sonarqube<\/code> user, run <code>chown -R<\/code> on the install directory, start as that user<\/td><\/tr><tr><td>UI still warns about the embedded database<\/td><td>The JDBC URL is commented out, the wrong file was edited, or an environment variable overrides it<\/td><td>Check <code>conf\/sonar.properties<\/code> and the service environment<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Best practices for production<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Back up the database on a schedule, for example with <code>pg_dump -Fc sonarqube<\/code>. SonarQube state lives in PostgreSQL, so these backups are your disaster recovery.<\/li>\n\n\n<li>Give SonarQube its own database and an account that is not a superuser. Do not reuse the <code>postgres<\/code> superuser.<\/li>\n\n\n<li>Keep PostgreSQL on a version that your SonarQube release lists as supported, and check this before every SonarQube upgrade.<\/li>\n\n\n<li>Store database credentials in a secrets manager or in the service environment, not in files committed to version control.<\/li>\n\n\n<li>Run SonarQube behind a reverse proxy with HTTPS. Do not expose port 9000 directly with a public IP.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For more on code analysis tooling, see the <a href=\"https:\/\/www.devopsschool.com\/blog\/category\/devops\/code-analysis\/\">Code Quality &amp; Analysis tutorials<\/a>. For PostgreSQL and other database topics, see the <a href=\"https:\/\/www.devopsschool.com\/blog\/category\/database\/\">Databases tutorials<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Can I migrate existing SonarQube data from H2 to PostgreSQL?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. SonarQube does not provide a supported H2-to-PostgreSQL migration tool. You start with an empty PostgreSQL database, restore exported quality profiles and re-analyse your projects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is the default SonarQube login after switching to PostgreSQL?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A new database starts with the default <code>admin<\/code> \/ <code>admin<\/code> account. SonarQube makes you change the password at the first login.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Which PostgreSQL version does SonarQube support?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The supported range depends on the SonarQube release. Check the prerequisites page in the SonarQube documentation for your exact version before you choose the PostgreSQL image tag.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can SonarQube and PostgreSQL both run in Docker?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. Put both containers on the same user-defined Docker network and set <code>SONAR_JDBC_URL=jdbc:postgresql:\/\/sonar-postgres:5432\/sonarqube<\/code>, using the database container name as the host. Mount volumes for SonarQube&#039;s data, extensions and logs directories as well as for PostgreSQL.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does SonarQube fail to start after I change the database?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Usually it is one of three things: SonarQube cannot connect to PostgreSQL, the <code>sonar<\/code> user is missing schema privileges, or Elasticsearch refuses to start because of kernel limits. Check <code>web.log<\/code> and <code>es.log<\/code> in <code>$SONARQUBE_HOME\/logs<\/code> for the exact error.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/devops\/code-analysis\/\">More Code Quality &amp; Analysis tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/database\/\">More Databases tutorials<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This page shows how to move SonarQube off its embedded H2 database and onto PostgreSQL: run PostgreSQL in Docker, point sonar.properties at it, set the kernel limits&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[62,10975],"tags":[7295,581],"class_list":["post-29864","post","type-post","status-publish","format-standard","hentry","category-code-analysis","category-database","tag-postgresql","tag-sonarqube"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/29864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=29864"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/29864\/revisions"}],"predecessor-version":[{"id":80722,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/29864\/revisions\/80722"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=29864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=29864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=29864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}