Meridian handbook
ReferenceCLI

serve

engine-dmo serve: start the server (public sites, admin, portal, APIs, jobs and scheduled tasks in one process), its boot sequence, what it refuses, and its flags.

Start the server. One process serves every site’s public pages, the admin, the member portal and the APIs, runs background jobs, and competes for the scheduler lease to run scheduled tasks.

engine-dmo serve [flags]
FlagTypeDefaultMeaning
--listenstringOverride server.listen for this run, such as 0.0.0.0:8080
--migrateboolApply pending migrations before serving, for this run
--devboolDevelopment: reparse templates on every request, the development error page, the config watcher (a valid change restarts the engine in this process), the extensions’ development servers as children (the Vite extension’s Vite), and the profiler at /_debug/pprof/. The profiler and debug endpoints stay off in production
--rolestringallAccepted values web, worker, all. In this release every value runs everything; there is no process that only serves or only runs jobs

--json prints the text output in the JSON envelope. Runs in a project.

What happens at boot

  1. The configuration is loaded and validated. Any problem is printed with its file, line and column, and the process exits 3.
  2. The extensions named in extensions: are loaded.
  3. The database is connected, and a server older than PostgreSQL 14 is refused.
  4. Migrations are checked. Pending migrations stop the boot with exit 2 unless migrate.on_boot: apply or --migrate; an applied migration whose file changed stops it with exit 1.
  5. The project is loaded and compared with the schema in the database. A difference is handled by schema.on_drift (refuse by default: exit 2 with the plan).
  6. The storage is proved writable (filesystem) or proved to accept a write, read and delete (S3). Failure stops the boot.
  7. Templates are compiled; a template error stops the boot with exit 3.
  8. The listener binds, the metrics listener binds on telemetry.metrics.bind, the page cache warms when enabled, and readiness turns true.

On SIGINT or SIGTERM readiness turns false at once, in-flight requests have up to server.shutdown_grace to finish, and the process exits.

Exit codes

CodeWhen
0Stopped by a signal after a clean shutdown
1Boot failed (database unreachable, storage not writable, a migration file changed), or the server failed
2Refused: migrations pending, or configuration drift with schema.on_drift: refuse. The output names the command that fixes it
3The configuration or a template is invalid

Examples

engine-dmo serve                               # production: after migrate up and schema apply
engine-dmo serve --listen 127.0.0.1:8090 --dev # local development
engine-dmo serve --migrate                     # a simple single-process install

For local development, engine-dmo dev up adds checking, id writing and safe schema applies on every configuration change. See Database and migrations and Monitoring.