Chapter 03Lesson 03~120 minutes

Installation Prerequisites, Database Planning, and First Server: Configuration, Design Patterns, and Trade-Offs

Choose an installation and database pattern by separating evaluation convenience from production durability, least privilege, search storage, network trust, and rollback requirements.

Design patternsPostgreSQLService accountNetwork boundaryRollback

Learning objectives

  • Compare ZIP/service and container deployment models without confusing packaging with architecture.
  • Choose between H2 evaluation and a supported external production database using durability and recovery requirements.
  • Design a least-privilege service identity and writable-path model.
  • Separate local bind, reverse proxy/TLS, and broad network exposure decisions.
  • Use current host/database requirements and rollback evidence to justify an installation pattern.

1. Start with operating requirements, not the easiest command

A Docker one-liner and a ZIP extraction can both produce a local SonarQube UI, but they do not answer production questions: who owns the process, where durable state lives, how search I/O behaves, how secrets are injected, how upgrades are performed, or how traffic is authenticated and encrypted.

Design from required state and trust boundaries first. Packaging comes later.

2. ZIP/service versus container path

Dimension ZIP/service Container
Java runtime Host must provide a current supported JDK. Image includes its runtime, but image version/digest still matters.
Host search prerequisites Apply directly to host. Still apply to the container host; containers do not erase them.
Filesystem Explicit data/log/temp paths and ownership. Explicit volumes/mounts and container UID/permissions.
Upgrade unit New distribution + config/data/database compatibility plan. New image + persistent-state/database compatibility plan.
Rollback misconception Replacing binaries is not automatically a supported DB downgrade. Re-pointing an old image at an upgraded database is not automatically supported.

Chapter 04 will teach container mechanics in depth. Here the design lesson is that packaging changes process/file delivery but not the fundamental database, search, host, identity, and trust requirements.

3. Evaluation database versus supported production database

H2 optimizes the first five minutes of a lab. PostgreSQL/SQL Server/Oracle support a durable production lifecycle. The choice should follow recovery, concurrency, availability, vendor operations, and supported-version requirements—not “which one started with zero configuration.”

Question H2 lab Supported external DB
Production supported? No Yes, when using a currently supported engine/version/configuration
Best use Trial, learning, short-lived test Persistent governed instance
Backup design Do not build production recovery around it Use DB-vendor + SonarQube supported procedures
Credentials Implicit lab convenience Least privilege and secret-management boundary

At this authoring date, current Community Build documentation lists PostgreSQL 14–18, SQL Server 2017/2019/2022, and Oracle 19C/21C/23ai family support. Re-check this table against the exact SonarQube release before every real deployment.

4. Least-privilege service identity

The SonarQube process needs enough authority to read its software and write its configured data/log/temp directories. It does not need root as its normal Unix identity. A dedicated account improves auditability and makes permission failures visible during deployment instead of being hidden by superuser access.

Design test: if the service account can modify unrelated system files, log into unrelated databases, or read production secrets that SonarQube does not need, the identity boundary is too broad.

On Windows, the same principle applies to a service account: use the minimum filesystem, service-logon, network, and database rights required by the documented deployment.

5. Search storage and filesystem design

SonarQube’s embedded search is I/O-sensitive. Current host guidance specifically warns against remote-mounted storage such as NFS/SMB/NAS for the search data path. Fast local/block storage and sufficient free space reduce latency variance and search failure risk.

For ZIP installs, production guidance also recommends keeping data and temp outside the versioned installation directory. That makes upgrades cleaner and makes it explicit which directories are mutable state versus replaceable software.

# Illustrative production-shaped paths
sonar.path.data=/var/sonarqube/data
sonar.path.temp=/var/sonarqube/temp

6. Local bind versus reverse-proxied production endpoint

A local lab at 127.0.0.1:9000 has a small trust boundary. A production endpoint normally introduces DNS, reverse proxy/ingress, TLS, forwarded headers, firewall rules, authentication, and monitoring. Those are separate layers; exposing :9000 directly to broad networks because “it works” bypasses the opportunity to design them.

Do not disable TLS verification to solve certificate problems. Diagnose certificate trust, proxy forwarding, and endpoint identity at their owning layers. Deeper proxy/TLS administration belongs to later chapters.

7. Worked decision matrix

Scenario Recommended pattern Why Evidence before approval
One-day local training Community Build ZIP + H2 + localhost Fast, free, disposable, narrow trust boundary Release/JDK/hash/port/log manifest
Small persistent internal service Single-node ZIP/service or container + supported external DB Durable DB, managed identity, explicit storage and network boundary Host requirements, DB compatibility, service account, backup/upgrade plan
Container-standardized platform Pinned official image + persistent supported DB/storage Fits image lifecycle without pretending containers remove host prerequisites Image digest, host limits, volume ownership, DB and secret plan
High availability requirement Evaluate licensed Data Center topology Single Community Build node is not an HA cluster Edition/license, current topology, DB, network, capacity and operations review

8. Rollback means state compatibility, not “put the old ZIP back”

SonarQube upgrades can migrate database state. Therefore the presence of an older ZIP or image does not prove you have a supported rollback. A real rollback plan starts with tested database backup/restore, exact release compatibility, plugins, Java/database versions, and documented update paths.

For a first installation, record enough to recreate the service from nothing: binary/image identity, JDK, host limits, database version and schema owner, paths, service identity, network path, plugins, and configuration. This turns installation into infrastructure evidence rather than workstation folklore.

9. Why this matters in DevOps

The deployment pattern determines who can recover, upgrade, audit, and scale the service. A “working” server with undocumented database state, root execution, mutable network shares, floating images, or direct public exposure creates operational debt before the first repository is analyzed. Good platform engineering makes every boundary visible and reviewable.

Knowledge check

Does Docker remove SonarQube’s Linux embedded-search host prerequisites?

Why is H2 a design smell in a persistent production instance?

What is the main security advantage of a dedicated SonarQube service account?

Why can’t an old image be assumed to be a rollback after an upgrade?

When should you consider Data Center Edition rather than adding a second independent Community Build instance?

Next lesson

From design choices to evidence-first failure diagnosis

Lesson 4 deliberately breaks runtime, host-limit, database, privilege, storage, and network assumptions and shows how to preserve the original evidence before correcting the owning layer.

Official references and version notes

Version and compatibility note

Version-sensitive statements were rechecked against current SonarSource primary documentation on 2026-09-07. Executable ZIP examples pin SonarQube Community Build 26.9.0.129388. Current Community Build host requirements specify a JDK with Java 21 or 25 for ZIP installation. Current database guidance treats embedded H2 as test/trial-only and lists PostgreSQL 14–18 plus supported Microsoft SQL Server and Oracle versions. Linux embedded-search prerequisites include vm.max_map_count ≥ 524288, fs.file-max ≥ 131072, at least 131072 open file descriptors for the SonarQube user, and at least 8192 threads. Re-check all of these before future reproduction.

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this address.