Skip to content

App hosting

App hosting runs your Docker Compose app on a server we prepare for your account. Caddy serves it over HTTPS on your domain. You deploy by image tag, and LeafCloud rolls back automatically when the health check fails.

To ask for it, email admin@leafcloud.in. The leaf app commands answer with the same message while an account is not enabled.

One server can host several apps for your account. Each app has its own directory, Compose project, Caddy site and memory limit, and each is deployed and rolled back separately. A server has a total memory budget; the apps registered on it must fit.

For each app we need:

  • the app name (a lowercase letter, then 1 to 38 lowercase letters, digits or dashes);
  • the domain it will answer on;
  • its Docker Compose file;
  • the image and tag convention, and a read-only registry login if the image is private;
  • how to tell it is healthy: by default a TCP check on its port, or an HTTP health path that answers when the app is up (keep that endpoint shallow; see Deploy an app);
  • the memory limit for the app, in MiB;
  • any environment variables, and the named volumes you want backed up.

We register the app and prepare the server. The domain’s A record points at the server; Caddy obtains its certificate on the first request. The compose file must publish its ports on loopback (127.0.0.1:3000:3000), use the deploy tag in the image name (image: ghcr.io/<owner>/<app>:${APP_TAG}), set restart: unless-stopped, and define a healthcheck. Write its command in the shell form, for example test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:3000/health"]: the server’s container runtime splits an exec-form command (test: ["CMD", ...]) on spaces, which can leave the check unhealthy forever. Exec-form checks are converted to the equivalent shell form automatically, so either works, but the shell form is the clearer one to read. Do not set a memory limit in the compose file: the server writes one for every service from the app’s registered memory limit.

Changing the compose file, environment, domain or memory limit is done with us; it is not a CLI command.

  1. Build and push the image to your registry with a tag, for example the commit SHA.
  2. Run leaf app deploy <app> <tag>.

The server pulls the image, starts it, and checks the health URL. A successful deploy keeps the tag as the app’s current tag and the tag it replaced as the previous tag. A failed health check rolls the app back to the previous tag.

See Deploy an app for the full workflow, rollback and CI.

CommandWhat it does
leaf app listList your apps with their current tag, domain and last deploy state.
leaf app create <name> --preset <size> [--tier economy|standard|dedicated]Create an app. economy is the default tier.
leaf app show <app>Show the app’s domain, running tag, previous tag, tier, sleep setting and last deploy.
leaf app deploy <app> <tag>Deploy an image tag. The app may come from [app] name in leaf.toml. Add --wait to stay until it finishes.
leaf app rollback <app>Switch back to the previous tag. Add --wait to stay until it finishes.
leaf app deploys <app>List recent deploys, newest first.
leaf app deploy-log <app> <deploy-id>Print the output of one deploy.

Every command accepts --json. List commands print one object per line; see the JSON output reference.

  • Only one deploy or rollback runs per app at a time. A second request while one is queued or running is refused with A deploy of this app is already queued or running.
  • An account may request 30 deploys and rollbacks an hour.
  • Only the current and previous tags are kept. Rolling back twice switches between them.
  • A tag is 1 to 128 letters, digits, dots, dashes or underscores. It cannot be rollback or start with a dash or a dot.

Prices for app hosting are not published yet; ask when you request it. See Pricing and limits.