LDM Conventions & Configuration Architecture¶
Note
This guide details the 3-tier configuration hierarchy, default infrastructure parameters, out-of-the-box port routing, and volume storage conventions enforced by Liferay Docker Manager (LDM).
๐๏ธ 1. Configuration Precedence Levels¶
LDM evaluates settings using a strict precedence hierarchy. Higher levels override lower levels without exception:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1. CLI Flags & Runtime Arguments (Highest Precedence) โ
โ e.g. ldm run --port 9090 --db postgresql โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 2. Project Local Metadata (<project>/meta) โ
โ written by ldm run/up; scoped to that one project โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 3. User Defaults (~/.ldmrc, "defaults" block) โ
โ e.g. ldm defaults port 9090 โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 4. Machine Defaults (/etc/ldmrc, "defaults" block) โ
โ e.g. ldm defaults db_type postgresql --global โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 5. Convention Defaults (in LDM itself; not a file) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- CLI Flags & Arguments (Level 1): Command-line parameters passed directly to commands (e.g.
ldm run --port 9090) take precedence over all stored configuration. They are not merely for one invocation:ldm runpersists what it resolved into the project'smeta, so the value survives into laterldm upcalls that omit the flag. - Project Local Metadata (Level 2): Stored as
metainside the project root directory (the older.liferay-docker.metaand.ldm.metanames are still read). Manages project-specific ports, database engine and mode, search modes, and attached client extension mappings. - User Defaults (Level 3): The
defaultsblock of~/.ldmrc. Set withldm defaults <key> <value>; view the whole resolved cascade, and where each value came from, withldm defaults. - Machine Defaults (Level 4): The
defaultsblock of/etc/ldmrc, for shared workstation images and CI agents. Set withldm defaults <key> <value> --global. - Convention Defaults (Level 5):
CONVENTION_DEFAULTSinldm_core/defaults.py. Not a file and not editable โ the values that apply when nobody has chosen one.
Important
ldm defaults <key> and ldm config set <key> are not interchangeable (LDM-#1651).
ldm config set writes the root of ~/.ldmrc, which is the right home for
credentials and machine-local settings (ngrok_authtoken, share_provider).
Cascading defaults are read from the defaults block, so a cascading key written to
the root is invisible to every command that resolves it. LDM now refuses that write
and names the command that works, rather than reporting a success with no effect.
Both files are plain JSON and can be inspected directly, but prefer the commands โ
ldm defaults reports which level each effective value came from.
๐๏ธ 2. Default Infrastructure & Ports¶
When running ldm run without overriding flags, LDM provisions the following out-of-the-box stack:
| Component | Default Convention | Host Port | Description |
|---|---|---|---|
| Liferay Version | Latest LTS | N/A | Automatically resolves and pulls the latest verified LTS container tag. |
| Database | PostgreSQL | 5433 |
Shared Global Infrastructure container (liferay-db-global, published on 5433), reducing memory consumption across projects. MySQL/MariaDB shares its own global container (liferay-db-mysql-global, published on 3307). |
| Search Engine | Elasticsearch 8.x | 9200 |
Shared Global Search service. Isolated sidecars are supported via --search-mode sidecar. |
| Reverse Proxy | Traefik | 80, 443 |
Automated HTTP/HTTPS routing with mkcert zero-config SSL certificates. |
| Default Hostname | localhost / <project>.local |
8080 / 443 |
Auto-resolved in /etc/hosts to loopback (127.0.0.1) or target node IP. |
๐พ 3. Hybrid Volume & Mount Strategy¶
LDM uses a hybrid storage architecture to maximize performance while preventing POSIX lock deadlocks:
- Named Docker Volumes (POSIX Lock-Sensitive):
Directories subject to heavy OSGi lock contention (
osgi/state,data,work) are backed by high-performance named Docker volumes. This definitively prevents file-locking deadlocks on macOS (Colima/VirtioFS) and Windows (WSL2). - Bind Mounts (Hot-Reloading & Code Sync):
Directories meant for developer iteration (
deploy/,modules/,client-extensions/) are bind-mounted directly from the host workspace, enabling instant file synchronization and auto-deploy scanner triggers.
Last Updated: 2026-09-10 | Last Reviewed: 2026-09-10