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] | Flag | Type | Default | Meaning |
|---|---|---|---|
--listen | string | Override server.listen for this run, such as 0.0.0.0:8080 | |
--migrate | bool | Apply pending migrations before serving, for this run | |
--dev | bool | Development: 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 | |
--role | string | all | Accepted 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
- The configuration is loaded and validated. Any problem is printed with its file, line and column, and the process exits 3.
- The extensions named in
extensions:are loaded. - The database is connected, and a server older than PostgreSQL 14 is refused.
- Migrations are checked. Pending migrations stop the boot with exit 2 unless
migrate.on_boot: applyor--migrate; an applied migration whose file changed stops it with exit 1. - 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). - The storage is proved writable (filesystem) or proved to accept a write, read and delete (S3). Failure stops the boot.
- Templates are compiled; a template error stops the boot with exit 3.
- 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
| Code | When |
|---|---|
0 | Stopped by a signal after a clean shutdown |
1 | Boot failed (database unreachable, storage not writable, a migration file changed), or the server failed |
2 | Refused: migrations pending, or configuration drift with schema.on_drift: refuse. The output names the command that fixes it |
3 | The 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.