Docker Compose Deployment
Compose Deploy accepts reviewed Docker Compose YAML using pre-built images. Use Git Deploy when the application must be built from source. The panel interprets supported Compose fields; it does not run an unrestricted docker compose up on the host.
Prepare and deploy
Open Services → Deploy Service → Deploy your own app, paste the Compose file (or choose Paste Compose instead first), enter a service name, customer and size, and click Deploy; see Deploy your own app. The old /services/deploy/compose address opens that form in Compose mode. The API (POST /api/v1/services with composeYaml) did not change.
A published port (ports: ["8081:80"]) is accepted but never opened on the server: the panel keeps the container port (80) as the app's routed port, drops the host binding, and the deploy log says so ("port 8081 on the server isn't opened; the app gets a web address instead"). A port published on 127.0.0.1 only (a debugger, say) is neither opened nor routed. expose says the same without a host port. The panel opens the service's page at once; its Deploy section shows each step (each opens to its output) and then Deployed or the reason it failed. Inspect the application logs before testing the service's HTTPS URL. If the first deploy fails before anything started, the service is removed; its page keeps showing the reason and the deploy's output for 14 days, and Fix and retry opens the form filled in again. The browser keeps your Compose file for that, but never its secret values: the value of every key whose name contains PASSWORD, SECRET, TOKEN or API_KEY, and a password inside a URL (postgres://user:password@…), are left empty, and the form names the keys to fill in again.
This minimal example routes to nginx on container port 80:
services:
web:
image: nginx:stable-alpine
expose:
- "80"
Use expose (or ports, see above) for the application's container port. Routing selects the first service whose container port matches the declared web port. When no web port is declared or no service matches it, routing prefers, in dependency order, a service that published a port other than a well-known database or cache port (5432, 3306, 6379, 27017 and similar), then any service that published a port, then the first service with a port that is not a database or cache port, then the first service with any port. A database listed before the web app therefore never takes the address. If no service declares a port, no routing target is selected. Pasted Compose ignores the aiadminpanel.primary label; that label's selection rule belongs to Git Deploy's repository Compose parser.
For a pasted multi-service stack, publish or expose a port on the intended HTTP service and avoid unnecessary port declarations on database or cache sidecars: a sidecar that only exposes a port is never chosen over a service that published one, but two services that both publish web ports are chosen between by dependency order. This automatic choice gives the main address to one service. Verify the HTTPS URL after deployment. Additional custom hostnames are managed through the service's Settings tab, in its Domains card.
Send an address to another container
When the automatic choice is wrong, or a second part of the app needs its own address (for example the voting app's vote page on the main address and its result page on results.example.org), choose the container for each address. In the Domains card of an app with more than one container, every address has a Goes to list:
- Automatic keeps the choice above. The list names the container it picked.
<container>· port<port>sends the address to that container of this app and that container port. The list offers the ports each container's image exposes.- A custom domain left on Automatic follows the main address, wherever it goes.
Saving restarts the app's containers once, so the proxy picks the change up. An app built from Git picks it up at its next deploy, and the card says so. The choice is kept through redeploys, restarts and moves to another customer. If a later Compose file removes the chosen container, that address stops answering and the list shows the old choice as "no longer in this app" until you pick another one; it never moves to a container you did not choose.
The panel only accepts a container of the same app and a port that container exposes. An app whose template declares its web ports keeps them: only a declared port can be chosen, and an app with several named addresses keeps the routing its template sets. API: PUT /api/v1/services/{id}/domains/{domainId}/target with {"service": "result", "port": 80} ({"service": "", "port": 0} goes back to Automatic); MCP tool set_domain_target.
The app starts private
A service deployed from Compose starts private, like every app: only a browser signed in to the panel can open its address until you click Make public on the service page. Other services of the same customer reach it over that customer's private network; anything else only through its address. See App Access.
Variables and persistence
Use the supported ${AAP_*} system tokens described in Template Authoring, such as ${AAP_URL} and ${AAP_PASSWORD_DB}. Reuse the same full token wherever one value must match. Arbitrary double-brace placeholders are not password generators.
Prefer named volumes for application data and keep their mount paths aligned with the image's requirements.
Folder mounts
The panel never mounts a folder of the server into an app. What happens to each kind of volumes: entry:
| Entry | What the panel does |
|---|---|
Named volume (pgdata:/var/lib/postgresql/data) | Mounted as a volume of this service |
Project folder (./data:/app/data) | Turned into a persistent volume of this service, mounted at the same path. It starts empty: no file from your computer or repository is copied into it. The deploy progress says so for each one |
Anonymous volume (/app/cache) | Not mounted; the folder lives in the container and is lost on the next deploy |
Server folder (/srv/app:/data, ~/x:/data), the whole project folder (.:/app), or a path outside it (../x:/data) | Refused before anything is deployed, with the service and mount named |
Volumes are labelled with their service: they survive redeploys and updates, are included in the service's backups, and are removed when the service is deleted.
A project-folder mount suits a data folder. It does not work for files the app needs at start (a health-check script, ./nginx.conf): the app sees an empty folder where they should be. For a Git deploy, the panel refuses such a mount when the repository holds files there. Put the files into the image instead (COPY in a Dockerfile, with build:); in a pasted Compose file, a configs: entry with inline content: also works. A container restart policy and a healthcheck serve different purposes; an unhealthy running process is not automatically repaired by declaring a healthcheck. Verify persistence through an application-specific recovery procedure; review the backup limitations.
Each named volume is a volume of the service on the server, named after the service's ID: data becomes aap_<service id>_vol_data. Services that existed before the panel was updated past 2.26.0 keep their earlier names (<service name>-<4 characters of the ID>_data), so their data and backups stay where they are; nothing is renamed or copied. Every redeploy, restart with new settings, address change and move to another customer mounts the same volumes again; backups include them and deleting the service removes them. Before a container is created, the panel checks that each volume it mounts is labelled with this service. A deploy stops, before anything else changes, when a volume of that name already exists for another service or without a label, typically one a deleted service left behind. An administrator then checks that volume with docker volume inspect <name> and removes it, or keeps it and contacts support, before deploying again.
Validation limits
The Compose validator rejects privileged containers, added capabilities, host network/PID/IPC namespaces, mounts of a server folder (including the Docker socket), and build: directives. Published host ports are not refused; they are never opened (see above). Selecting a template's raw profile does not grant privileged Docker access through this validator. Host environment variables are not passed to the Compose loader for interpolation.
Every container also gets the panel's hardening baseline, whether or not the file asks for it: 16 capabilities are dropped (among Docker's defaults that removes NET_RAW, so no raw network sockets) and no-new-privileges is set. What the file can and cannot change:
| Compose key | Effect |
|---|---|
cap_drop | Honoured, in addition to the baseline. It can remove more capabilities, never fewer |
cap_add, privileged | Refused when the file is validated |
security_opt | Only no-new-privileges is accepted, and nothing is passed to Docker: the baseline sets it (no-new-privileges:false is granted to a few reviewed templates only). Any other entry (seccomp=…, apparmor=…, label=…, systempaths=…) is refused, because it would switch off a protection |
shm_size | Honoured up to 16 GB: the size of the container's /dev/shm (Docker's default is 64 MB). More is refused when the file is validated. It uses memory only as it fills, and counts against the service's memory limit; a size above that limit is lowered to it |
tmpfs | Honoured: up to 16 in-memory folders per service, each up to 16 GB (/tmp:size=256m,mode=1777). One without a size gets 1 GB; a size above the service's memory limit is lowered to it, because what is written there counts against that limit. Options allowed: size, mode, uid, gid, ro/rw, exec/noexec; nosuid and nodev are always set. Refused when validated: suid, dev, any other option, size=0 or a percentage, a folder that is /, under /proc, /sys or /dev (use shm_size for /dev/shm), /etc/hosts, /etc/hostname or /etc/resolv.conf or a folder above them, a folder that is also a volume, and a folder that would hide one of the app's config files |
pids_limit | Every container has a process limit (processes and threads together, the cgroup pids.max), so one app cannot fill the server's process table and stop other apps from starting. The default is 4096. pids_limit (or deploy.resources.limits.pids) sets another whole number from 1 to 16384; -1, unlimited, a fraction or more than 16384 is refused when validated. Apps that were already running when the panel was upgraded get the limit when the panel starts, without a restart (see Apps that ran before the upgrade). See App hits its process limit |
ulimits | Honoured for nofile (open files, up to 1048576), nproc (processes, up to 65535) and core: 0 (no core dumps). Any other limit (memlock, rtprio, nice, stack, …), -1 (unlimited), a value above the maximum, or a soft value above the hard one is refused when validated |
volumes: | Named volumes are mounted; a project folder (./data) becomes a volume; a server folder or a path outside the project is refused. See Folder mounts |
logging | Partly honoured; see Container logs |
Every Compose key
Each key a service can set is honoured, refused (the deploy fails and Check before deploy names the key and the reason) or ignored with a warning (the deploy goes ahead; its progress and Check before deploy name the key). No key is dropped without a word.
| Handling | Keys |
|---|---|
| Honoured | image, build (Git apps only), command, entrypoint, environment, expose, ports (container port only, see above), volumes (named volumes), depends_on, healthcheck, configs (inline content:; the target must be a clean absolute file path such as /etc/app/config.yaml, and a folder of it the image lacks is created), cap_drop, logging, shm_size, tmpfs, ulimits, pids_limit (see above), networks (the app's own network replaces them; service names still resolve), extends (same file only), profiles (a service in a profile is not started, as with docker compose up), restart: always / unless-stopped |
| Honoured, with limits | user (a name or id, optionally :group), working_dir (absolute path), stop_signal (a signal name such as SIGQUIT), stop_grace_period (at most 10m), init, read_only (ignored with a warning when the service has configs, which the panel writes into the container), extra_hosts (name:IP address, at most 32), sysctls (only net.core.somaxconn, net.ipv4.ip_local_port_range, net.ipv4.ip_unprivileged_port_start, net.ipv4.ping_group_range, net.ipv4.tcp_fin_timeout, net.ipv4.tcp_keepalive_intvl, net.ipv4.tcp_keepalive_probes, net.ipv4.tcp_keepalive_time, numeric values), labels (at most 64; a traefik., aiadminpanel. or com.docker. label is ignored with a warning, and the panel's own labels always win) |
| Refused: access to the server or other apps | privileged, cap_add, devices, device_cgroup_rules, volumes_from, use_api_socket, userns_mode, cgroup_parent, cgroup: host, uts: host, network_mode/pid/ipc set to host or to container:…/service:…, extra_hosts with host-gateway, env_file, label_file, extends with a file:, and the top-level include (these four would make the panel read a file of its own server) |
| Refused: switches off a protection | security_opt other than no-new-privileges, oom_kill_disable |
| Refused: wrong value | a value of the keys "Honoured, with limits" outside the limits above, and a sysctls name not in the list |
| Ignored: the panel decides | container_name, hostname, domainname, mac_address, dns, dns_opt, dns_search, links, external_links, platform, pull_policy, other restart values, other network_mode/ipc/cgroup/uts values |
| Ignored: resource limits | cpus, cpu_count, cpu_percent, cpu_period, cpu_quota, cpu_rt_period, cpu_rt_runtime, cpu_shares, cpuset, mem_limit, mem_reservation, memswap_limit, mem_swappiness, blkio_config, oom_score_adj, deploy (except deploy.resources.limits.pids, read as pids_limit), scale, gpus, storage_opt. Set CPU, memory and GPU in the app's resource settings |
| Ignored: not supported | annotations, attach, develop, credential_spec, provider, group_add, isolation, models, runtime, secrets (use environment variables or inline configs), stdin_open, tty, post_start, pre_stop, a configs entry with file: or external: |
| Not accepted by the Compose format | dockerfile, log_driver, log_opt, net, volume_driver (old version 1 keys): the file cannot be read |
An image that needs sudo or another setuid helper as a non-root user does not start under this baseline. See Upgrade & Uninstall for how to find such services before an upgrade.
Use the image's supported non-privileged configuration. If it needs unsupported host access, this deployment method cannot provide it. Do not remove validation controls to make an example run.
Manage each container
A Compose app runs one container per Compose service. Its service page shows a Containers section with one row per Compose service, named as in your Compose file (vote, worker, redis), never by a raw container ID. Each row shows:
- Status: running (and healthy or unhealthy when the image has a health check), starting, restarting, stopped or failed.
- Image and Restarts: how often Docker restarted the container. A number that keeps growing usually means the container crashes on start.
- CPU / memory: the container's own last reading, not a sum over the app.
- Main address: the container the app's address goes to.
Each row has three actions:
| Action | What it does |
|---|---|
| Logs | Opens the Logs drawer filtered to this container. The Container filter there switches to another one or back to All containers |
| Restart | Asks first, then restarts this container only. The other containers keep running. Needs the permission to start and stop services |
| Terminal | Opens the terminal inside this container (platform operators only, and only while it runs). The Container list above the terminal switches to another one |
A service with a single container shows no Containers section; its page looks as before. The same list and the restart are in the API (GET /api/v1/services/{id}/containers, see Services API) and in MCP (list_service_containers, restart_service_container).
Container logs
Docker's default log driver keeps everything a container prints in one file that never stops growing, so one chatty app could fill the server's disk. Every container the panel creates for an app, whether from a template, a Compose file, an image or a Git repository, therefore gets the same limit as the panel's own containers: the json-file driver, at most five files of 10 MB each, older ones compressed. That is about 50 MB of log per container. Logs on the service page and docker logs show what is still kept.
A Compose file may set its own logging: block for a service. The panel keeps it within these limits:
In logging: | What the panel does |
|---|---|
driver: json-file or local, or no driver | Used. max-size, max-file and compress you set win; the ones you leave out get the panel's value |
driver: none | Used: the container keeps no log, and Logs stays empty |
Any other driver (syslog, gelf, fluentd, awslogs, …) | Ignored, and the panel's limit applies. Docker itself would open that connection, so the file could point the server at any address |
| Any other option, or a value Docker cannot read | Ignored |
services:
web:
image: nginx:1.27
logging:
options:
max-size: "50m" # this service keeps up to 5 x 50 MB
Docker reads these settings only when it creates a container. An app deployed before this release keeps unlimited logging until you Redeploy it; a restart is not enough.
Troubleshooting
App hits its process limit
Every app container may run at most 4096 processes and threads together, unless its Compose file sets pids_limit. When an app reaches the limit, the kernel refuses new processes and threads, and the app's log shows errors such as:
fork: Resource temporarily unavailableorfork: retry: Resource temporarily unavailablecan't create thread,pthread_create failedorjava.lang.OutOfMemoryError: unable to create native threadEAGAINorResource temporarily unavailablefrom a call that starts a process or thread
The app keeps running, but new work fails. To check, open the container's terminal and run cat /sys/fs/cgroup/pids.current /sys/fs/cgroup/pids.max. A first number at or near the second confirms it.
If the app really needs that many, raise the limit for its service in the Compose file and redeploy:
services:
app:
image: example/app:1.0
pids_limit: 8192 # whole number, 1 to 16384
A leak (a worker pool that keeps growing) is not fixed by a higher limit, so check the app first. A file stored before this limit existed may hold pids_limit: -1 or a value above 16384. When such an app's containers are recreated (for example after an environment change or a move to another customer), they get 16384 and the panel logs a warning. A new deploy of that file is refused until the value is corrected.
Apps that ran before the upgrade
A container keeps the settings it was created with, and a restart does not change them, so containers created before the process limit existed had none. When the panel starts, it now sets the limit on every app container that has none, live and without a restart: the pids_limit of the service in the app's stored Compose file (a stored -1 or a value above 16384 becomes 16384), or 4096. A container that already has a limit keeps it. The panel's own containers, the login server, the database, the proxy, the model server and backup helpers are not touched.
The panel log names each container it changed (process limit set on a running app container). A container that already runs as many processes and threads as its limit, or more, is left without one and logged (process limit not set): set a higher pids_limit for that service and redeploy. A container the panel could not change is logged too (process limit could not be set). The app keeps working and can be redeployed at once, which applies the limit; otherwise the panel tries again at its next start. The panel does this in the background after it starts, so it does not delay sign-in. Only when Docker stops answering in the middle of the change, so the panel cannot tell whether it applied, is the app held for a check, as after any interrupted operation.
An app deployed from a template before the limit existed has a stored Compose file without the template's own pids_limit (12288 for ClickHouse, 8192 for the code workspaces), so it gets 4096, as a recreate would. Redeploy it from the template to get the template's value.
Image refused: reserved labels
The panel inspects each image after it is pulled. An image that ships a label whose name starts with traefik. or aiadminpanel. (upper or lower case) is refused, and there is no override: those labels control public routing and service ownership, and Docker copies an image's labels onto its container.
What to do: rebuild or re-tag the image without those LABEL lines, or use a different image, then deploy again. The service's deployment history names the image and the labels. On a redeploy the check runs before the running containers are stopped, so the service keeps running and keeps its status. Labels written under labels: in pasted Compose are not applied to the container at all.
Deployment failed: another operation did not finish
A deploy or redeploy does not start while another operation on the same service (a deploy, a secret rotation, a subdomain change, a reassignment) is running. It waits, shown as pending, and starts when that operation ends. When the other operation has not ended after 50 minutes, the deployment is recorded as failed at its next look, about 80 minutes after you pressed the button, with the reason "another operation on this service did not finish within 50m0s, or failed and is awaiting reconciliation; nothing was changed". Nothing was pulled, stopped or started. This applies to template deployments as well.
What to do: if the other operation is still running, wait for it and deploy again. If it failed and left the service blocked, a hosting administrator clears the service's operation claim first; the procedure is in Rotate a Service Secret. Then press Redeploy.
Deployment refused: an earlier operation failed or was interrupted
When an earlier operation on the service failed after it had started to change the service (for example a deploy that failed while creating containers), the service stays blocked until a hosting administrator has checked it. A deploy or redeploy then does not wait: it is recorded as failed at once, with the reason "deploy refused: an earlier operation on this service failed or was interrupted and may have changed it, so the service is blocked until an administrator checks it and clears its operation claim; nothing was changed". Nothing was pulled, stopped or started.
What to do: a hosting administrator checks the service and clears its operation claim, as described in Rotate a Service Secret. Then press Redeploy.
A deploy that was interrupted before it changed anything, for example because the panel was restarted or updated while the image was still being pulled, does not block the service. It is recorded as failed with "context canceled" in the reason, the previous containers keep running, and Redeploy runs at once. A deploy interrupted after the old containers started being removed does block the service as described above, because nobody can tell without looking how far it got.