Skip to content
zefıly

Deploy

Containers and Compose

Run a registry image, your Dockerfile, a repository without one (Railpack) or a Docker Compose file as a site, rootless, with blue-green releases.

Container sites run with rootless Podman as the site's own Linux user: a container can never act as root on the server. The web server in front handles the domain and HTTPS.

Add a container site

Add site with Runs on: Container (Docker):

Field Meaning
Image (optional) A registry image such as ghcr.io/acme/app:1.0. Leave it empty to build from your repository on every deploy (its Dockerfile, or Railpack without one).
Container port The port your app listens on inside the container. It is published on the server's 127.0.0.1 only.
Compose file (optional) Run a Docker Compose file from your repository instead of a single image.
Published service The Compose service your domain points to; it listens on the container port.

Image, Dockerfile or Compose

  • Image: every deploy pulls the image and restarts the container. Use tags you control (1.4.2 rather than latest) to know what runs.
  • On a site that runs an image, the Deploy page shows an image field instead of a repository: change the image there and the next deploy pulls it. A site built from a repository keeps its Dockerfile.
  • Dockerfile: set up a Git deploy; every deploy builds the image from the Dockerfile (or Containerfile) at the root of the repository, then starts it. Build commands run before the image build. The site's .env is available to the build as a secret, never stored in the image: RUN --mount=type=secret,id=env cat /run/secrets/env.
  • No Dockerfile: Railpack reads the repository, detects the stack (Node.js, Python, Go, PHP, Ruby, Java, Rust, Deno, static sites…) with its versions, build and start commands, and BuildKit builds the image, inside the site user's rootless Podman for the duration of the build. Your app gets the container port as PORT. The deploy log shows what Railpack detected. To change how it builds, add a railpack.json to the repository (see Railpack's documentation) or a Dockerfile.
  • Compose: the Compose file is started with podman-compose. Its ports are removed and only the published service is reachable, on 127.0.0.1, plus the extra ports you publish; other services stay on their private network. Data folders mounted from the repository are moved to the site's shared directory so they survive releases.

Settings that would escape the sandbox are refused: privileged containers, host networking, the host's PID or IPC namespace, devices and added capabilities.

Private registries

A private image needs a login. On the server page, open Container registries and enter the registry host (for example ghcr.io), your username and a token with read access to the packages, not your account password. Every container site on the server pulls with it. The token is stored encrypted and is never shown again: saving the same host again replaces it, and removing a login takes effect on the next pull. The server's agent must be updated first; the page says so when it is not.

Pull limits

Registries limit how often anonymous clients pull. Docker Hub's published limit for anonymous pulls is 100 pulls per six hours per IPv4 address (or IPv6 /64 subnet); a personal account gets 200. When a registry refuses a pull for its limit, the deploy stops with the reason (for example "registry rate limit reached for docker.io") and the server's Activity entry links to Container registries. Add a login there, or deploy again later. Zefily does not retry by itself: the registry does not say when its limit resets.

Blue-green releases

A single-container site switches to a new release without a gap. The new release first runs as a second container beside the live one and must answer on its own; only then does the web server send traffic to it while the main container restarts on the new image, and then back. A release that does not answer never takes traffic: the deploy stops, the deploy log shows its last log lines and the live release keeps running. Once traffic is back, the main container must stay up on the new release for about 20 seconds: a restart in that time fails the deploy and the previous release comes back. A site with persistent data (a volume, such as Grafana, Metabase, n8n or PocketBase) has no second container: its one container restarts on the new release, so the site is unreachable for a few seconds. Compose sites restart their services instead. A one-click container app with a slow first start (Grafana, Metabase) gets a longer wait for its new container to answer before the release counts as failed.

Extra published ports

Game servers, MQTT brokers, SMTP relays and similar services need ports besides the web port. On a container or Compose site, open Deploy, then Published ports and add each port:

  • Protocol: TCP or UDP.
  • Server port: from 1024 to 65535, on every address of the server (a game port such as 25565 works).
  • Container port: the port the container listens on.
  • Compose service (Compose sites only): the service that publishes the port.

Up to 10 ports per site. Database and cache ports (MySQL, PostgreSQL, Redis, MongoDB and the like), the server's SSH and web ports, the ports of the server's own services, the ports of the sites on the server (and their blue-green ports), and ports that a service on the server already uses are refused. The firewall opens exactly these ports for their protocol as soon as you save; removing one closes it. The container publishes a new port at the site's next deploy: until then it keeps the ports it had. A rollback of a Compose site publishes the ports the site has now, not the ones its old release was made with. A site move carries its ports: the new server must have them free (a refusal names the port before anything is copied); they open on the new server and close on the old one at the switch. The API takes the same list (PUT .../published-ports).

Container port

The port the app listens on inside its container is set when you add the site. To change it later, open Deploy on a container or Compose site and set Container port (1 to 65535), then save. The next deploy starts the container with the new port: Zefily publishes it on the server's loopback address and sets the PORT variable to match, and a Compose file's published port is rewritten the same way. Until that deploy, the site keeps running on the old port. One-click apps and app stacks keep the port their template sets.

Container socket

A tool such as Portainer can manage a container site's own containers through a socket. Turn on Container socket in the site's settings to give the site a socket of its own: the site user's rootless Podman socket, which speaks the Docker API. Podman starts the socket for that user only, and it is mounted into the container at /var/run/docker.sock at the site's next deploy. For a Compose site, choose the service that gets it.

Turning it on needs your passkey approval. Turning it off stops the socket, and the mount is removed at the next deploy.

Warning: a tool with this socket can manage every container of this site, but nothing outside it. It cannot reach the server's own containers, other sites or the root Podman socket. Turn it on only for a tool you trust.

Health and rollback

A deploy starts the site's web unit, so the site answers at once; a suspended site stays stopped. After a deploy, the site must answer within a few minutes (the first start of a stack may take up to 15 minutes while images download and apps initialize). If it does not, the previous release comes back and the deploy log ends with the containers' last log lines.

Automatic image updates

A container site that runs a registry image can keep it current. On the site's Deploy page, switch on Automatic image updates, choose every day or once a week (and the day), and an hour in UTC.

At each check the panel asks the registry for the digest behind your tag and compares it with the digest the site last ran; an unchanged digest pulls nothing. A deploy of the image records the digest it pulled, so the first check after a deploy compares with it; a site with no record yet (deployed before this, or after a rollback) gets its digest recorded by the first check, which pulls and restarts nothing. When it changed, the new image is pulled and the container is recreated on it with the same settings and port. The new container must become healthy: if the image has a health check, it must pass; otherwise the app must run for 20 seconds and answer on its port. If it does not, the previous image comes back and you get an email and a bell notice. The previous image is kept until the next successful update.

  • An image pinned by digest (name@sha256:...) is never updated automatically; the Deploy page says so. Switch to a tag to use the schedule.
  • Use a tag you trust: a tag such as latest moves on its own schedule, so an update can bring a new major version. Pin a major version (16, 2.x) to take only compatible updates.
  • Check for update now runs the same check at once. The history lists each check as up to date, updated, rolled back, needs attention or failed.
  • A stopped site is not checked. The server's agent must be updated to a version with automatic image updates.

Shell in a container

The Shell pane of a container site opens a shell inside one of its running containers: bash when the image has it, otherwise sh. It is the site user's shell in the site's own containers, not a root shell on the server: whatever runs in the container is root only inside it, and the rootless Podman setup keeps that root away from the server.

  • Needs the operate permission on the server (the same one that manages sites).
  • The shell is recorded like every terminal session and listed with the server's terminal recordings.
  • It ends after 30 minutes, whatever you do, and after 15 minutes without input. Open it again to continue.
  • A Compose site offers its published service's container. A stack site (Supabase, Nextcloud, Ghost, OpenClaw, Hermes Agent) offers its long-running services: pick one in the Shell list. The default is the stack's main service; for Hermes Agent that is agent, where hermes model sets the model provider, and its WebUI is the other choice. One-off helper containers are not offered.
  • The server's agent must be updated to a version that supports container shells.

Environment, data and logs

  • The site's .env is passed to the containers.
  • Container sites reach the server's MariaDB or PostgreSQL through the host address; connect a database to get the right DATABASE_URL.
  • Named volumes keep data between deploys.
  • Data the image declares as a VOLUME (a Dockerfile VOLUME line) that no volume of the site covers is kept automatically in the site's own folder, so a redeploy keeps it, backups include it and a move carries it to the new server. The first deploy after the agent update copies what the running container keeps in those paths, once. The Deploy page lists them under Kept automatically. Such a site restarts its one container on each release, like a site with a volume. Data written anywhere else in the container is listed under Data outside a volume (see below): keep it in a volume.
  • The Logs pane shows the app's output under App process.

Data outside a volume

A container keeps what its app writes outside its volumes in its own writable layer, and a new container starts with an empty layer. Zefily reads that layer about ten minutes after the first successful deploy and then once a day, and the Deploy page lists the folders it finds under Data outside a volume. The owners and admins are told once, by e-mail and under the bell, when a new folder appears; the notice opens the site's Deploy page.

A redeploy, a rollback or a move starts a new container, so the data in those folders would be lost. A deploy therefore stops and names the folders until you choose:

  • Keep moves a folder into a volume of the site: its data is copied out of the running container, and the volume is mounted on the next deploy. From then on the data is copied again before each redeploy.
  • Deploy anyway lets the deploy go ahead, and the data in those folders is lost.

After a deploy stops on these folders, the Deploy page shows the same choices at once, even before a fresh check, and the stop names the folders it found.

A rollback stops in the same way. Keep the folders first and roll back, or choose Roll back anyway: the panel names the folders and the release the site returns to, and the rollback goes ahead only after you tick the confirmation (it is never ticked for you). The choice appears after a fresh check (Check now), so the release it names is the one the site returns to. It needs an agent update: on an older agent the panel says so and offers no such choice, and the rollback stops as before.

A move to another server also waits: keep the folders, or confirm that their data is lost. The container itself is kept between restarts, crashes and server reboots, so its data stays there until a deploy or a rollback replaces it.

Files owned by another user. Before a redeploy, upgrade or rollback, the agent checks the site's data folders for files owned by a user other than the site user. If it finds any, it stops, names their paths, and the current release keeps running. To fix it, change the owner of the listed files to the site user (for example chown -R on those paths), then deploy again. If a new release fails to start after the old one was stopped, the panel brings the previous release, its data mounts and its web unit back automatically. A release whose deploy failed and never went live is never a rollback target.

Compose stacks are checked per service: each folder is listed with its service (for example web: /app/data), and Keep applies to that service. A stack's containers are reused on every start and reboot, and a deploy or a rollback removes them only after the paths you keep are copied out. Each service's anonymous volumes and the folders its image declares as VOLUME are kept in the site's folder automatically, as for a single container. A stack keeps at most 10 kept paths per site.

Ready-made containers and stacks are in Container apps and App stacks.

Updated November 26, 2026 View as Markdown llms.txt

Still stuck?

Open a ticket from your panel or write to us; we answer within a day.

Contact →

Runs the stacks you already use

Black Friday & Cyber Monday

Before you go: lifetime plans are on sale

Pay once for a lifetime plan, or get 30% off the first year of any yearly plan.

Only 100 lifetime plans per plan. When they are gone, they are gone.

See the campaign

Amazing November

See the campaign →