Actions
39 actions, callable from the panel, the command palette and the API as
POST /api/v1/a/<id>. Internal actions used between modules are not listed.
| Action | What it does | Risk | Preview |
|---|---|---|---|
containers.runtime.install | Install the container runtime | critical | |
containers.runtime.info | Container runtime status (read) | low | No dry run |
containers.stack.validate | Validate a Compose file (read) | low | No dry run |
containers.stack.deploy | Deploy a stack | medium | |
containers.stack.update | Update a stack | medium | |
containers.stack.deploy_git | Deploy a stack from a Git repository | medium | |
containers.stack.git.sync | Redeploy a stack from its Git repository now | medium | |
containers.stack.git.unlink | Stop following the Git repository | low | |
containers.stack.webhook.receive | Receive a Git webhook for a stack | medium | No dry run |
containers.stack.start | Start a stack | low | |
containers.stack.stop | Stop a stack | low | |
containers.stack.restart | Restart a stack | low | |
containers.stack.remove | Remove a stack | high | |
containers.stack.list | List stacks (read) | low | No dry run |
containers.stack.get | Get a stack (read) | low | No dry run |
containers.logs.get | Stack logs (read) | low | No dry run |
containers.exec.open | Open a shell in a container | medium | |
containers.stats.get | Container stats (read) | low | No dry run |
containers.endpoint.list | Published endpoints (read) | low | No dry run |
containers.image.pull | Pull images | medium | |
containers.image.prune | Remove unused images | medium | |
containers.registry.add | Add a registry credential | medium | |
containers.registry.list | List registry credentials (read) | low | No dry run |
containers.registry.remove | Remove a registry credential | medium | |
containers.catalog.list | List catalog apps (read) | low | No dry run |
containers.catalog.get | Get a catalog app (read) | low | No dry run |
containers.catalog.install | Install a catalog app | medium | |
containers.catalog.upgrade | Upgrade a catalog app | high | |
containers.catalog.rollback | Roll back a catalog app | high | |
containers.images.check | Check for newer images (read) | low | No dry run |
containers.images.update | Update the images of a stack | medium | |
containers.reconcile | Re-apply every stack | low | |
containers.swap.reconcile | Stop containers and app processes from using swap | low | |
containers.firewall.requirements | Ports container stacks open to the internet (read) | low | No dry run |
containers.certs.sync | Refresh a stack's certificate files now | high | |
containers.backup.sources | List what a backup of this account should also hold (read) | low | No dry run |
containers.backup.stage | Copy a stack's volumes into the home for the backup | medium | |
containers.backup.unstage | Remove the staged copies of the volumes | low | |
containers.backup.restore | Put backed-up volumes into a new stack | high |
Permissions and limits
Permissions
containers.stack.viewView stacks, logs and statscontainers.stack.operateStart, stop and restart stackscontainers.stack.webhookRedeploy a stack when its Git repository is pushed tocontainers.stack.execOpen a shell inside a stack's containerscontainers.stack.manageDeploy, change and remove stackscontainers.image.managePull and remove imagescontainers.registry.manageManage private registry credentialscontainers.catalog.viewBrowse the app catalogcontainers.runtime.adminInstall and administer the container runtime
Plan limits
containers.stacksStackscontainers.cpuCPU of all containerscontainers.memory_mbMemory of all containerscontainers.public_portsPorts open to the internet
Engineering notes
Generated from modules/containers/docs.md at build 38156245. These are the notes the engineers keep
next to the code: precise, technical, and honest about what is not done yet.
Docker Engine (from Docker's official apt repository) with userns-remap, the systemd cgroup driver and log
rotation. Every stack is a Compose project rc-<account>-<stack> whose containers live in the account's cgroup slice.
A shell inside a container is opened from the stack's Services tab (containers.exec.open, permission
containers.stack.exec, a Team member needs that grant on the stack) and live logs follow with search (see
"Shell in a container and live logs" below).
Isolation model (what is enforced, and where)
- The user's YAML never reaches docker.
modules/containers/composeis an ALLOW-LIST validator: it parses with line numbers into a typed Spec and Renders a new canonical file. Unknown keys are refused ("option X is not supported"), dangerous ones with a specific reason. The control plane validates before it stores; the agent validates again (internal/agent/containers.go: ctrBuild) so a compromised control plane cannot push a privileged stack. - Refused (each tested with the offending line):
privileged,network_mode,pid/ipc/uts/userns_mode,devices,cap_addoutsideCHOWN DAC_OVERRIDE FOWNER FSETID KILL SETGID SETUID SETPCAP NET_BIND_SERVICE SYS_CHROOT,security_opt,sysctls,cgroup_parent,volumes_from,extra_hosts,env_file,build,container_name, custom/external networks, named volumes withdriver/driver_opts/external(atype: none, o: bindvolume would be a host mount), host-path mounts outside/home/<account>/(incl...,/home/<account>2, the home itself, the Docker socket), bind options (propagation), ports on any address but 127.0.0.1 (see "Ports" for the public exception),$(…)/${X:-y}interpolation, undeclared${VAR}, merge-key/anchor tricks (the node tree is flattened before checking). - Rendered for every service:
cgroup_parent= the account slice (sliceUnit),cap_drop: ALL+ the small allowed set,no-new-privileges,init: true, CPU/memory (no swap; labelrespirecloud.swap: allowon a service allows it, slower but survives memory spikes)/pids limits (defaults 0.5 CPU, 256 MB, 512 pids), json-file log rotation (10 MB x 3), labelsrc.account/rc.stack, one project network. Ports are127.0.0.1:<port>(see "Ports"). - Bind mounts (
./data=<home>/containers/<stack>/data, or an absolute path inside the home) are created by the agent component by component withopenat(O_NOFOLLOW): a symlink planted in the home cannot redirect root's mkdir/chown (lab-verified:containers/evil -> /etcis refused, nothing appears in /etc). New directories are owned by container root (the dockremap uid base) with the account's group, setgid. Compose files usecreate_host_path: false. - Compose + secrets live in
/var/lib/rc-containers/<account>/<stack>/(root, 0700): compose.yaml has only${VAR}references; values are in a root-only.env(single-quoted literals; quotes/backslashes/newlines refused). Secret variables are stored in the vault (stack/<id>/<KEY>), never in the module tables, logs or events;stack.getmasks them. - Registry credentials: vault secret per credential; written to
/var/lib/rc-containers/<account>/.docker/config.json(0600) and used asDOCKER_CONFIGfor that account's pulls only.
Actions
runtime.install/info (admin) · stack.validate / deploy / update / start / stop / restart / remove / list / get ·
logs.get (tail + cursor: pass next as since to follow) · stats.get · endpoint.list · image.pull / prune ·
registry.add / list / remove · catalog.list / get / install / upgrade / rollback · reconcile · internal
on_account_deleted (subscription to accounts.deleted: removes the stacks even though the Linux user is already gone).
deploy, update, remove, catalog.install, catalog.upgrade support dry-run (plan with a real compose diff and a
secret-masked .env diff). The containers run inside the account's slice, so an install is fitted to the smaller of containers.memory_mb and the slice's MemoryMax (sizing.ram_mb), and refused plainly below the template minimum.
Limits containers.stacks, containers.cpu (millicores), containers.memory_mb and containers.public_ports are
Reserved on deploy (sum of service limits; update reserves the delta), released on remove/failure/account deletion.
The per-service ceiling is the account's containers.cpu / containers.memory_mb limit. Limits follow
core.EffectiveLimit (w12): an administrator's own account (the server owner's, bound to the administrator) is
unlimited unless a plan it is on sets the key; hosting accounts and resellers get the module default.
Ports (w12, owner-limits)
- No host port (
"8080","127.0.0.1::8080"): the panel picks a loopback port from 20000-29999 (stack_ports), reusing the stack's previous one. - A host port written out (
"127.0.0.1:27017:27017","27017:27017", long syntaxpublished:) is kept exactly as written, on 127.0.0.1 (a file without an address still binds to 127.0.0.1, never to every address). It must be 1024-65535. The control plane refuses it when another stack on the server has that port and protocol; the agent refuses it when anything else listens there (the panel, nginx, a database), unless the stack's own containers hold it. - A public address (
"5.196.79.222:3478:3478/udp") only for a stack whose account may open ports to the internet (containers.public_portsnot 0: an administrator's own account, or a plan that grants it; customers default to 0, so their ports stay on 127.0.0.1 with the message "ports are published on 127.0.0.1 only"). The address must be one of the node's own (checked by the agent from its interfaces;0.0.0.0is refused), the host port must be written, and each one counts againstcontainers.public_ports. The same port may be used once per protocol (coturn: 3478 UDP and TCP). The preview says in plain words which ports open to the internet. - Firewall:
containers.firewall.requirementslists the public ports per node; a deploy, update or removal that touches one emitscontainers.firewall.changed, andsecurity.on_containers_changedreplaces therc-containers:allow rules (normal auto-rollback timer; skipped on a node without a panel-managed firewall). Removing the stack removes its rows, so its rules go with it. Docker publishes through its own forwarding rules; the panel rule is what the firewall screen shows and what keeps the port open when the panel firewall filters forwarded traffic.
Long operations are agent jobs
Agent calls are capped at 60 s by the transport and sdk.Host.Agent cannot raise it. Stack apply, image pull and
snapshot take/restore therefore return CtrJobStarted at once; the control plane polls containers.job.status (short
calls) in agentJob until done. One job per stack at a time (conflict otherwise). Jobs live in agent memory: after an
agent restart the poll reports an unknown job and the caller runs containers.reconcile.
Reverse-proxy contract with web
Containers publishes to 127.0.0.1:stack_ports, unique per node and protocol; endpoint.list gives host_ip, fixed, public).
The web module's reverse-proxy site type:
- calls
containers.endpoint.list {account_id}(permissioncontainers.stack.view; the user's own account, or any account for admin/reseller) and lets the user pick an endpoint:{stack, service, container_port, upstream: "127.0.0.1:20001", primary, websocket, health_path, status}; - renders an nginx site
proxy_pass http://<upstream>(WebSocket upgrade whenwebsocket), TLS fromssl, and only switches the route when the stack isrunning(health_path = path to probe on the upstream); - subscribes to
containers.stack.deployed(payload{id, name, account, node_id, status, endpoints[]}) to re-render when a port changes and tocontainers.stack.removedto remove the site. It must treat an upstream as valid only if it is127.0.0.1and listed bycontainers.endpoint.list(a public endpoint is never an upstream). Domain ownership stays indomains; containers never touches nginx.containers.domain.publishfrom the spec is therefore not implemented here: it is the web module's site type.
One-click catalog
templates/<id>/{manifest.yaml, compose.yaml} + templates/index.json (sha256 of every file) + index.json.sig
(ed25519). catalog.Load refuses unsigned, wrongly signed, unknown-key, tampered, or missing/extra files with the reason
(tested). The binary embeds the catalog signed with the dev key (seed from a public constant, rc-dev-1, see
tools/sign); release builds sign with the release key (RC_CATALOG_KEY_FILE/RC_CATALOG_KEY_ID) and trust it.
Manifest: id, name, template version, app_version, category, description, icon, licence, adapted_from, typed
variables (string/password/url/domain/number/bool/email; default, generate: password:N|hex:N|base64:BYTES|uuid,
secret, pattern, required), requirements, web {service, port, websocket, health_path}, backup {volumes, hooks},
post_install {open_path, note, credentials}, upgrade_notes. The healthcheck is the compose healthcheck: a stack is
healthy only when every one passes. Install resolves variables (generating secrets), checks plan limits, deploys, and
returns the credentials ONCE. Starter set (10): WordPress, Ghost, n8n, Uptime Kuma, Gitea, Nextcloud, Plausible, Metabase,
SeaweedFS (S3), Valkey.
Upgrade: pre-upgrade snapshot (tar of the stack's named volumes, stack stopped meanwhile) -> apply the new template ->
wait for health; on failure (or unhealthy) it re-applies the previous revision AND restores the snapshot automatically.
Rollback (manual) is available for 7 days after an upgrade (revision N-1, optional data restore). Revisions keep the
compose and non-secret variables; secret values stay in the vault.
Verified in the lab (2026-10-09, Ubuntu 24.04 node, Docker 29.9.0, Compose 5.6.0, vfs storage)
See the handover for commands. Docker installed through the op; userns-remap + systemd cgroup driver active; Uptime Kuma
from the catalog healthy on 127.0.0.1:20000 (container process = host uid 100000, cgroup
rc.slice/rc-acct.slice/rc-acct-alice.slice/docker-<id>.scope, mem/cpu/pids limits, capdrop=ALL); every refusal via the API
with its line; symlink-escape bind refused; secrets only in .env/vault; limits (stacks=3, cpu) refuse the extra
deploy; env update; reconcile recreates a killed container; stop/start/restart; logs (ANSI stripped) and stats; upgrade
1.0.0->1.0.1 with snapshot, manual rollback with data restore, automatic rollback after a failing upgrade; remove frees
containers/volumes/networks; account deletion removes its stacks via the event.
Securing first-run setup
Bots watch certificate-transparency logs and open an unfinished web installer within minutes of a new hostname getting
its certificate (this happened to a test WordPress: the attacker made their own admin and planted spam). A catalog app
must therefore never be reachable with an open "create the administrator" page. Rule: the admin is created at deploy
time from generated variables and shown once through post_install.credentials.
Fixed (admin provisioned at deploy time, installer closed):
- wordpress - one-shot
setupservice runswp core install(idempotent,restart: "no");ADMIN_USER,ADMIN_EMAIL,ADMIN_PASSWORD,SITE_TITLE;install.phpnever opens. - gitea -
INSTALL_LOCK=true, registration off, one-shotsetupservice runsgitea admin user create. - nextcloud - already provisioned from
NEXTCLOUD_ADMIN_*env.
Still OPEN (interactive first-run wizard only, no env or CLI we could confirm; the manifest note warns the customer to
finish setup immediately): ghost (/ghost/), metabase (setup wizard), n8n (owner sign-up), plausible
(/register, first account becomes owner), uptime-kuma (first-visit admin form). valkey and seaweedfs have no
web installer.
These five need a web-layer gate, which is a change in the web module, not in a template: until setup completes the
app URL should require HTTP basic auth or a one-time token (generated at install, shown once, dropped when the app
reports setup done), so only the customer reaches the wizard. Until that exists the window is dangerous. Candidates to
replace the gate later if the images confirm it: Plausible ADMIN_USER_EMAIL/ADMIN_USER_NAME/ADMIN_USER_PWD with
db init-admin, n8n owner provisioning from env. Verify against the pinned image before using; do not guess variables.
Known limits / follow-ups
- userns-remap is per daemon, not per account (one
dockremaprange): container root is an unprivileged host uid but it is the same uid for every account; AC-containers-06 (files owned by the account user) is only approximated (account GROUP + setgid). Per-account uid ranges need rootless Podman per account (security's preferred runtime) - next step. - Container egress to host services on the bridge gateway is not filtered (firewall belongs to
security); icc is off on the default bridge only. A port the panel picks from its range is not checked against other programs on the host (fixed and public ports are). Port ranges (40000-49999:40000-49999) are not supported in compose files yet. - No Git deploy, jobs, scale, exec, platform stacks/host network, CVE scan, admin kill/GC, custom catalog sources, per-pack
entitlements, backups integration (hooks are declared and stored;
backupsis not built), domain publish (web), UI. - Snapshots are tarballs on the node (not yet registered with
backups); the 7-day window is checked, not enforced by GC. accounts.deletefirst asksaccounts.deleting(synchronous,Host.EmitSync);containers.on_account_deletingstops and removes every stack of the account while its Linux user and slice still exist. A stack that fails to go stops the delete and names the reason;accounts.deletedthen only cleans registries (and sweeps stacks of accounts deleted by an older panel).
Shell in a container and live logs (w11-47)
containers.exec.open {id, service, cols, rows}: the caller must own the stack (or holdcontainers.stack.execon exactly that stack); the service must be running. containers then asksterminal.container.open(internal; refuses any caller but this module) for a PTY and returns a single-use ticket for the normal terminal stream. The session is always recorded, counted interminal.sessions, idle-closed like every terminal and ends with the panel session.- The agent builds the command:
docker exec --interactive --tty --env TERM=... <id> /bin/sh -c '<fixed>'. The container id is found by the account's own labels (rc.account,rc.stack, compose project and service), exactly one running container, so a stack name of another account finds nothing. No flag comes from the caller (no--privileged,--user,--volume,--workdir). The shell is the container's own configured user inside the container's namespaces and cgroup (under the account's slice, the stack's CPU / memory / pids limits), with the capabilities the stack was rendered with; with userns-remap container root is an unprivileged host uid. It is never a shell on the server. - Logs:
containers.logs.getfollows by cursor (since= the previousnext) and acceptsqto keep only matching lines. Each call is bounded (2000 lines, 1 MiB, 8 KiB per line); control sequences, other control characters and bidi overrides are removed in the agent, and the screen renders lines as text. It is a bounded poll (2.5 s), not a socket: a streamed socket would add a second long-lived gateway; the bound is what protects the node. - Stack names beginning
app-are reserved for the apps module (stack.deployandcatalog.installrefuse them).
Address at deploy time
Stack deploy and catalog install accept address and https. A supplied address is proxied to the primary published
endpoint. Clear Address to keep the stack private.
Stacks from a Git repository (w14)
containers.stack.deploy_git deploys a stack whose Compose file is in a repository of one of the account's Git
connections: pick the connection, repository, branch and the path of the file (default docker-compose.yml). The file is
read through the git module's API (git.repo.file), so nothing is cloned and a Compose file larger than 256 KB is refused.
The preview is the normal stack plan plus a line for the webhook.
- Variables and secrets are given in the panel and stay there; the repository never holds them.
- With "Redeploy when I push" on, the panel adds a webhook to the repository (
<panel address>/api/v1/hooks/stacks/<stack id>, its secret in the vault). A push to the stack's branch redeploys the stack in the background when the Compose file changed; a push that does not touch the file is recorded as "nothing changed". A push does not pull newer images: use Redeploy now with Pull images for that. - Without a public panel address no webhook is added; the deploy still works and says so.
containers.stack.git.sync("Redeploy now") reads the file again; its preview says when nothing would change.containers.stack.git.unlinkremoves the webhook and keeps the stack running with the file it has.- Removing the stack removes its webhook. The Git tab of a stack shows the repository, the last redeploy and its result.
Images are pinned to exact, newest-supported tags (2026-10-29)
Every template image is an exact tag (no latest, stable, bare major or missing tag); upgrade_notes records the source
and date of each choice. catalog/freshness_test.go fails on a floating image and on a pin below the floors in the test
(Valkey 9.1.3, SeaweedFS 4.51, ClickHouse 26.8, MySQL 8.4, MariaDB 11.4). Bumping version makes
containers.catalog.upgrade offer the change. A PostgreSQL data folder only opens in the major that wrote it, so
catalog.DatabaseJumpRefusal makes the upgrade of an install on PostgreSQL 16 to a template on 18 refuse with a plain
message (back up, install a new copy, restore); the app keeps running. Plausible keeps PostgreSQL 16.15 like its own
compose; MariaDB 11 to 12.3, MySQL 8.0 to 8.4 and ClickHouse 24.12 to 26.8 upgrade in place (the images migrate themselves,
and a failed health check rolls back with the snapshot). After editing a template run go run ./modules/containers/tools/sign.
Newer images
A stack keeps running the image tag written in its Compose file, so a newer release of Valkey, Meilisearch, coturn or any
other image goes unnoticed. containers.images.check (read-only, shown on the Containers page and on each stack's
Services tab) asks the image's registry for the newest stable tag: Docker Hub, ghcr.io and quay.io, anonymous. The answer
is kept about 12 hours (10 minutes when the registry failed); a daily schedule (containers.images.refresh) warms it.
- Same release line. For databases and stores (PostgreSQL, MySQL, MariaDB, MongoDB and Percona, Valkey, Redis, Meilisearch, ClickHouse, Elasticsearch, OpenSearch) the newest tag with the same major version is offered; MySQL, MariaDB and MongoDB lines are two numbers (11.8, 8.0). A newer major version is reported as "needs a planned upgrade" with the reason, never with an Update button. Other images get the newest stable tag of the same shape and variant.
- Skipped: pre-releases,
-rc,-beta,nightly, architecture-only tags, other variants (-alpinewhen yours is not), date tags,latest. Images set by a${VARIABLE}, on other registries, or onlatestare not compared. - Digest pins (
image: name:1.2.3@sha256:...): the digest of the newest tag is read and written with it; a pin whose tag was rebuilt shows as newer. - Security floors. A Valkey, PostgreSQL, MariaDB or similar version below a floor in
catalog/versions.jsonshows a "Security fix" chip and names the advisory in the details. - Catalog apps are not checked here: they follow their template (
containers.catalog.upgrade).
containers.images.update (risk medium, preview first) rewrites the chosen image tags in the stack's Compose file, applies
it with a fresh download and waits for every service to be healthy (default 180 s). If one is not, the old file is applied
again and the error says so. Meilisearch gets MEILI_UPGRADE_DB=true in its service when its version changes. Data is not
copied first, so back up a database before updating it.
Certificates for a stack (x-rc-certs)
A stack can use a certificate the panel already manages, for a name its own account owns, for example coturn serving TURN over TLS on 5349.
x-rc-certs: [turn.example.com] # up to 5 plain host names, no wildcards
x-rc-certs-group: 65534 # optional: the group id inside the container that may read the key (default 0)
x-rc-certs-reload: {service: coturn, signal: USR2} # optional: HUP, USR1 or USR2 after a change (default: nothing)
Each service in the stack gets /certs/<name>/fullchain.pem and /certs/<name>/privkey.pem, read-only. Rules:
- Deploy, update and the preview refuse (in plain words) a name the stack's account does not own or has no valid
certificate for. The check is
ssl.cert.stack_resolve: the same cross-account rule that guards issuing, plus the account must itself hold the name or a parent of it. Being an administrator is no shortcut. - The agent copies the key from the server's certificate store into
/var/lib/rc-containers/<account>/<stack>/certs/<name>/, owned by root, group = the container group above (inside the user-namespace remap), files 0640, directory 0750. The certificate must cover the name, match its key and still be valid. The directory is outside the account's home and is removed with the stack. - After a certificate is issued, renewed or revoked, or a domain is deleted,
containers.on_certs_changedrewrites the files of every stack withx-rc-certsand sends the reload signal if a file changed. A name the account no longer owns is not exported any more and its files are removed; the rest of the stack keeps running. containers.certs.syncdoes the same for one stack on demand; its preview lists which names go to which stack and changes nothing. Every export is audited (containers.certs.exported, names, certificate ids and serials, never the key), a withdrawal ascontainers.certs.withdrawn.- The certificate must be on the stack's own server (a certificate kept on another node is refused with a plain message).