- In the dashboard, open New resource, pick Docker Compose, then paste or upload the file. A preview lists every service, port, domain, volume and env var before anything is deployed.
- From the CLI, run
levelrail-cli compose deploy <app> -f compose.yaml. - From a template, open a template page and fill in its settings, or run
levelrail-cli templates install <id>.
build:, use a git deploy with build.type: compose (Deploying apps). This page covers compose files that use pre-built images.
Deploy a stack
What each key does
Values that are not finite, round to zero, are negative or exceed the cap are rejected at deploy time with the service and key named. Set
APP_COMPOSE_MAX_MEMORY_BYTES and APP_COMPOSE_MAX_CPUS on the control plane to lower the cap; unset keeps only the built-in overflow guard. shm_size is capped at 2 GiB by default; set APP_COMPOSE_MAX_SHM_BYTES (bytes) to raise or lower it. A service with shm_size and no memory limit counts its /dev/shm size against the project memory quota, since that memory comes from the host.
Keys that are ignored
A key outside the table above does not stop the deploy, but it is never dropped silently. Every ignored key is reported as a warning that names the service, the key and what to do instead.levelrail-cli apps deploy-compose prints each one with the file path, compose preview and apps validate list them, and the deploy API returns them in notices (level warning).
The warning has one fixed shape, with top-level in place of the service name for a top-level key:
remove it, or bake the setting into the image; it has no effect on how this service runs.
env_file and extends
env_file (a path, a list, or {path, required} entries) is read only for git deploys with build.type: compose. Paths are relative to the compose file’s directory and must stay inside the repository: absolute paths, .. escapes and symlinks leaving the checkout are rejected, as is a file larger than APP_COMPOSE_MAX_ENV_FILE_BYTES (default 256 KiB; the variable can only lower it). A missing file is an error naming the service and path, unless the entry has required: false. Files apply in order, later files win, and environment: overrides them all. Lines are KEY=VALUE with optional export, # comments and single or double quotes. Values are used as written, with no ${VAR} expansion, the same as environment: in a git deploy. Error messages carry line numbers, never values.
extends: {service: name} pointing at a service in the same file is merged before the file is read. command and entrypoint are replaced, environment and labels merge by key, ports, expose and env_file are concatenated, volumes merge by mount path, other maps merge deeply, and depends_on, links and volumes_from are not inherited. A missing parent or a cycle is an error. extends with file: is still ignored with a warning.
Supported subset
These service keys are read. Everything else is ignored with a warning, or rejected (see below). The list comes from the parser ininternal/compose.
build, secrets, configs and the host access keys listed under “What is rejected” are parsed only so they can be refused or redirected with a clear message. They are not supported. SERVICE_FQDN_*, SERVICE_URL_* and SERVICE_PASSWORD_* style variables from imported templates are rewritten into literal values or generated secrets before the file is parsed.
The ignored keys people paste most, and the fix for each:
More ignored keys and their alternatives:
x- extension fields are ignored by design, as the Compose spec allows. Anchors and merge keys (<<: *common) are resolved before keys are checked.
What is rejected
These keys widen a container’s access to the host, so a compose file that sets any of them is rejected with a clear error. The rule name in brackets matches the Docker socket guard (Docker access):privileged: true[privileged]network_mode: host[network_host], andnetwork_mode: service:...orcontainer:...pid,ipc,uts,userns_modeorcgroupset tohostcap_add(so noNET_ADMINyet, see UDP published ports),devices,volumes_from, andsecurity_opt(exceptno-new-privileges)- a bind mount of the Docker socket (
docker.sock,podman.sockorcontainerd.sock) from any path, plus system paths such as/,/etcand/var/lib/docker - top-level and per-service
secrets:andconfigs:
Status and per-service control
levelrail-cli compose status <app> and the Compose stack card on the app’s Services tab show:
- One phase for the stack:
running: every service is ready.progressing: something is still starting or waiting.degraded: at least one service is failing.failed: every service is failing.stopped
- Each service’s ready state with the reconciler’s reason, for example
WaitingForDependency,WaitingForDependencyHealthyorCreateFailed, plus its message.
<app>-<service>, with all the usual app pages. In the dashboard, the Logs tab of a multi-service app shows a Service selector that opens the logs of another member service.
Rollback
Every deploy records the compose file it used. Rolling back re-applies an earlier file through the normal deploy path and saves the result as a new revision, so you can roll forward again later. Generated passwords are stored per app, not per revision, so an older file still uses the same database password that the data in its volumes expects.Tear down
--volumes deletes the data for good and needs the write-sensitive ability.
Templates
A template is a directory underinternal/catalog/manifests/<id>/ with a template.yaml and a compose file:
${KEY}. When a template is installed, each setting gets the value the operator supplied, a generated secret (stored encrypted and reused on every redeploy), or the default.
Values are inserted into parsed YAML values, never into the raw text, so a value cannot change the structure of the file. A template whose settings and ${KEY} uses do not match fails to load. One that fails the compose rules above also fails to load.
TestComposeTemplates_Live). The rest of the catalog uses the older single compose body format and still deploys the same way.
Checking a batch of compose files
go run ./scripts/validate-templates checks every manifest. Add -compose-dir <dir> to also check a directory of plain compose files against the same rules a real deploy uses. Use this to triage a large catalog before converting entries to manifests. It prints one line per file with the first reason it was rejected. Add -json for machine-readable output and -strict to fail on any rejected file.
Pull request previews
When a compose app has pull request previews on, every service in the preview getsPR_NUMBER and PREVIEW_PR_NUMBER (the pull request number), PREVIEW_BRANCH, and PREVIEW_URL (only on the service that carries the preview domain, and only when a domain was assigned). Use them in your own env or entrypoint, for example to name a preview database. A PR_NUMBER your app already defines is kept.
Env vars per service
Every compose service is a member app named<app>-<service>, and its env belongs to that member only. A variable reaches exactly the services that declare it, and nothing is copied to siblings. To set a value for one service, address its member app:
environment: block in the compose file, then env set on the member app, then branch or pull request overrides on that member for previews. Generated secrets are encrypted per member and masked when listed. To give several services the same value, set it on each member.
Scheduled commands in a service
A schedule runs a command inside one service’s running container, through the same exec path as the console, so console exec must be on for that service (PUT /api/v1/apps/<app>-<service>/exec-access).
- Every run is kept in history with its trigger, status, exit code, duration and the tail of its output. How many bytes of output a run keeps is the
scheduled_tasks.max_output_bytesruntime setting, and how many runs are kept isscheduled_tasks.history_keep. Output is shown only to callers withread_sensitive. - A scheduled tick is skipped and recorded as
skipped_freezewhile a deploy freeze covers the service, the stack or everything. Run now still works during a freeze. A global freeze pauses compose service schedules only, not plain app jobs, and a freeze skip sends no heartbeat monitor ping. - Creating, running and pausing a schedule need access to both the stack and that service. An unknown stack, an unknown service and one you cannot read all answer
404 app not found. - The stack page shows every schedule in the Schedules card, with run now and the last runs of each.
- API:
GET /api/v1/apps/{name}/compose/scheduleslists them all;/api/v1/apps/{name}/compose/services/{service}/schedulestakesPOST, and/{id}takesGET,DELETE,POST /run,POST /enable,POST /disableandGET /runs.
Troubleshooting
Compose file was rejected as invalid
Likely cause: The compose file uses keys that are not allowed (privileged, cap_add, host networking, bind mounts of docker.sock, etc.), or it has syntax errors. How to confirm: Runlevelrail-cli compose preview -f compose.yaml. The preview will show which keys are rejected and why.
Fix: Remove the rejected keys from the compose file. Common issues: privileged mode, cap_add, bind mounts to /var/run/docker.sock, and host networking are all refused for security. Update the file and try again.
Service is not starting or is stuck waiting
Likely cause: A dependency is not healthy, or the service itself has a startup issue. How to confirm: Runlevelrail-cli compose status <app> and look for the per-service status. Check depends_on and service_healthy conditions in the compose file.
Fix: Check the service logs with levelrail-cli compose logs <app> --service <service> -f. If a dependency is not healthy, fix that service first (check its health check). If the service itself is failing, check logs for startup errors.
Generated secret value is wrong or missing
Likely cause: The template is missing the setting definition, or the setting is not used in the compose file with the correct variable name. How to confirm: Runlevelrail-cli templates get <id> and check the template.yaml for the setting definition. Look for the ${KEY} placeholder in the compose file.
Fix: Make sure the setting is defined in template.yaml and the variable name in the compose file exactly matches the key field. Generated values are stored per app and reused on redeploy, so environment changes to the setting do not affect existing apps.
Still stuck
For help with compose files, runlevelrail-cli compose preview <name> -f compose.yaml to see the full validation report. Check the app and service logs with levelrail-cli compose logs <name> [--service <service>].
Backing up a database service
Postgres, MySQL and MariaDB services in a compose app (detected by image name:postgres, postgis, mysql, mariadb) can be dumped on a cron schedule. The dump runs inside the service container with the engine’s own tool (pg_dump, mysqldump, mariadb-dump), using the credentials already in the container’s environment (POSTGRES_USER, POSTGRES_DB, MYSQL_ROOT_PASSWORD, MARIADB_ROOT_PASSWORD). The MySQL family password goes through MYSQL_PWD, never a command line. The dump then uses the same backup target, encryption, upload and retention as managed database backups. Dumps run on the control plane node, so the service must run there.
Schedules and run history for compose services are stored apart from managed database history. Each run is recorded with its status, size, object key and error.
In the dashboard, the Database backups card on the app’s Volumes tab lists each detected database service with its engine, its schedule and what its retention settings keep. Only users with the
write-sensitive ability can change anything. They choose a backup target, set a cron schedule, set how many backups to keep (Keep last) and an optional maximum age in days, pause or resume the schedule, remove it, or run a backup now. A new schedule starts with Keep last at 7. A value of 0 turns that limit off, and 0 for both keeps every backup. Read-only users see the schedule and the recent runs. If no backup target exists yet, the card links to Settings. The card does not appear for an app with no detected database service. There is no CLI command for these schedules yet. The card and these endpoints are built and unit tested, but not yet run against a live server.
Restore replaces a database service’s live data from one succeeded backup run. It needs the root ability.
Send
{"preview": true} first. It changes nothing and returns the run, object key, size, engine and the exact confirm phrase, which is restore <app>/<service>. A real restore needs confirm to equal that phrase, otherwise the call answers 400. Only a succeeded run can be restored (a failed or running one answers 409). Restoring into a new service (as_new) is not supported and answers 400.
Before it touches the database, the control plane checks the stored object against its recorded checksum, then takes a safety dump of the current data to the same backup target. If the checksum check or the safety dump fails, the restore stops and the database is left as it was. The safety dump shows up in the run history. The restore itself runs in the background and the outcome is written to the audit log as compose_db.restore.
In the dashboard, each succeeded run in the Database backups card has a Restore button. It opens a dialog that runs the preview, shows the engine, backup object and size, and asks you to type the confirm phrase exactly as the server returned it. The button is disabled for users without the root ability, with one line saying why. The dialog only reports that the restore was accepted and shows the safety dump id. Check run history and the audit log for the outcome. It has not been tried against a real database or in a browser yet.
From the CLI:
--yes and without a terminal the command sends no restore request. Postgres is replayed in one transaction after the public schema is reset, and the commit is only sent when the whole dump streamed cleanly and still matches its recorded checksum, so a damaged or cut-off dump rolls back. MySQL and MariaDB drop and recreate the service’s named database (MYSQL_DATABASE or MARIADB_DATABASE) before the replay; a service without one is refused, because a server-wide dump would rewrite the system schema and root credentials. A stream that fails midway is reported as failed, but MySQL and MariaDB cannot roll back, so the safety dump is the way back. Only one restore per service runs at a time; a second answers 409. This is built and unit tested but has not run against a real database container and bucket. To load a dump by hand instead, download the object from the backup target (decrypt it first if the target encrypts dumps) and use:
Imported stacks
migrate coolify and migrate dokploy stage multi-service stacks from those platforms as compose apps. Imported files are treated as untrusted: they go through the same parser and host-access rules as a pasted file, so a rejected key keeps the stack blocked with the same reason, and the importer never fetches anything over the network for them. Staged files land under --stage-dir with owner-only permissions; deploy them with levelrail-cli compose deploy <app> -f <path>.
Deploy a compose app from a git repository
Keep the compose file in a repository and let pushes redeploy the stack. Deploy the stack once (paste or template), then connect its repository:PUT /api/v1/apps/{name}/compose-source (write:sensitive), GET on the same path, and POST /api/v1/apps/{name}/compose-source/deploy. The webhook secret is shown once; rotate it, change trigger patterns or disconnect with the usual git-source commands.
- The file goes through the same deploy path as a pasted compose file, so every check (ports, quotas, privileged and host mounts, name ownership) applies unchanged.
- The path is relative to the repository root.
.., absolute paths and symlinks that leave the checkout are refused. The size cap is thecompose.repo_file_max_bytesruntime setting. include:,build:andextends:from another file are refused.env_file:is ignored as for a pasted file, and no.envis read from the repository: keep secrets in app env vars or secret placeholders.- Only pushes to the configured branch deploy and trigger patterns apply (trigger mode push or release). A push is held when any service of the stack is in a protected environment or a freeze window. Deploy now is refused in a protected environment. A held push belongs to the team that owns the stack’s services: an admin of that team decides it, and when the services belong to different teams the decider needs the admin role in every one of them.
- A push answers 202 and joins the deploy queue as one attempt under the app name, so the global deploy cap applies. Deploys of one stack run one at a time, at most one push waits (the newest), and a commit already deployed or older than the deployed or waiting one is ignored. The apply is bounded by the
compose.repo_deploy_timeoutruntime setting. Manual compose deploys, rollbacks and redeploys of the stack wait for a running push. The git poller does not poll compose sources. - A queued compose push shares the deploy queue and its global cap with every other app, so it can wait behind other deploys. Approving a held compose push, or the end of a freeze window, applies the stack before that step returns. A freeze window on the stack, on any of its services or a global one holds a waiting push, and a released or approved compose push is not applied while one is active unless the request overrode the freeze (it fails with the freeze reason; push again after the window). When the freeze state cannot be read, the deploy waits. Deploy now records the commit’s parent and time, so a later push of an older commit is ignored.
- A push deploy runs without a caller, so a file that bind-mounts a host directory is refused there; deploy that stack by hand as a root user. A push that adds a service whose name another app already uses fails with 409.
- The path is at most 512 bytes, with no control or format characters.
- An app has either a compose source or a single-service git source, never both (409).
- Removing the stack (
DELETE /api/v1/apps/{name}/compose) cancels its queued, held and approval-waiting deploys. The repository stays connected, but pushes do nothing until the stack is deployed again by hand. - Commit times more than a day ahead of the server clock are not used to order pushes.