One-click hosting templates
Leafen is one container with one data folder, so a hosting platform's one-click template needs little. Official templates are listed here; others may say "for Leafen", not "Leafen" (TRADEMARKS.md).
Official templates
| Platform | Template |
|---|---|
| Railway | Deploy on Railway Leafen receives a share of Railway's revenue from this template; the price you pay is the same. |
On Railway, the service and its volume, where Leafen keeps its data, are created in your preferred region (Railway's account settings): US West (California), US East (Virginia), EU West (Amsterdam) or Southeast Asia (Singapore). Choose the nearest before you deploy: moving the service later moves its volume too, which takes a while and stops the service meanwhile (Railway's regions).
What every template sets
| Item | Value |
|---|---|
| Image | the official Leafen image, ghcr.io/leafen-org/leafen:latest, fetched as published each time the service is deployed, as compose.yaml has Compose do (pull_policy: always): never a copy kept from an earlier deployment |
| Port | 8090 (HTTP; the platform's proxy adds HTTPS) |
| Command | the image's default: serve --http=0.0.0.0:8090 --dir=/data |
| Data | a persistent volume at /data — everything Leafen keeps is there |
| Health check | GET /api/leafen/v1/health → 200 |
| Memory | 1536 MiB or more; set LEAFEN_MEMORY_LIMIT to the plan's size (for example 1536m). Railway's template sets 1536m; on a plan with less (Railway's Trial gives 1 GB) nothing needs changing, as Leafen reads the container's own limit first and plans for that |
| Public address | LEAFEN_PUBLIC_URL = the https:// address the platform gives |
| Routing | WebSockets passed through (collaboration and live updates use them) |
| First administrator | LEAFEN_SETUP_CODE = a random code made at install (on Railway ${{secret(24, "0123456789")}}): the platform shows it among the service's variables. The server also prints a one-time setup link as it starts (LEAFEN_SETUP_OPEN_MODE=print, the image's default), and leafen setup link prints it again |
On Railway the template also sets PORT=8090 and RAILWAY_RUN_UID=0: Railway
mounts the volume owned by root, and the image runs as a non-root user, so
without it Leafen can't write to /data. It also sets LEAFEN_SETUP_LINK to
https://${{RAILWAY_PUBLIC_DOMAIN}}/setup#code=${{LEAFEN_SETUP_CODE}}, which
Railway fills in: the first setup's link with its code in it, so opening it
asks only for a name. Railway's Variables screen marks LEAFEN_PUBLIC_URL and
LEAFEN_SETUP_LINK with a "Public endpoint warning" about egress fees and
RAILWAY_PRIVATE_DOMAIN: it can be ignored. Both are addresses people and
agents open from outside; Leafen's own traffic to them is a small check now
and then that its address still reaches it.
Railway's Trial and Free plans give the volume 0.5 GB: a new server's databases and the room Leafen keeps free beside them take under 100 MB of it, and the rest holds files. A volume grows on the Hobby and Pro plans, 5 GB and 50 GB to start (open the volume and choose Live Resize; docs). A file the volume has no room for is refused with that reason, and the server's administrator is told to grow the volume.
The volume at /data is the only folder a template keeps: everything else
in the container, the image's /backups included, goes when the platform
deploys it again (a redeploy, an update). Leafen reads the container's mounts,
so on such a platform its backup screen doesn't offer /backups; it says to
back up to a WebDAV server or S3-compatible storage, or to make a backup file
and download it, and a folder that isn't kept is named as such, with how many
of the backups made there are gone. Mounting another volume at /backups makes
it a folder that is kept.
Renaming the service's domain on Railway lets the old name go at once: set
LEAFEN_PUBLIC_URL to the new address in the service's Variables and deploy
the change, and everyone logs in again at the new address (members without a
password with a device code from Settings › Server › Users). Until the
variable is changed, the links Leafen makes still name the old address; its
screens and the administrators' inbox say so.
Nothing else is required. Leafen's thanks in the app (the workspace menu's GitHub line, and the sponsor list and the row at
the bottom of Home that come in an early update after the first release) stay on by default; the server's administrator
turns them off in Settings → Server → Updates, and a host may set LEAFEN_SPONSOR_CREDIT=off to keep them off.
The first administrator on each platform
A server on a hosting platform is opened from the internet, through the
platform's proxy, so its first setup asks for a code; a server opened from
its own network (the same computer, a home or office network, Tailscale)
asks none (Self-hosting). A server
started with a setup code, as every template starts it, shows the code field
first from outside, under the name, with one line saying where the code is:
on Railway, which Leafen knows by the variables Railway sets in every
deployment (RAILWAY_PROJECT_ID and the like), in Railway's words; elsewhere,
among the service's variables. "Other ways" under it says where the setup
link is: on Railway, the template's LEAFEN_SETUP_LINK among the same
variables. On Railway without a code the page names the deployment's screen
that shows the link the server printed, and gives no advice about a home
network. Either of these works:
- the template's
LEAFEN_SETUP_CODE, typed in the setup code field; - the setup link,
…/setup#code=…, which opens the page with its code: on Railway the template'sLEAFEN_SETUP_LINK; anywhere, what the server prints as it starts andleafen setup linkprints again in the service's shell (the link names the platform's address when the template setsLEAFEN_PUBLIC_URL; otherwise open the same/setup#code=…on it).
Where to find them:
| Platform | The code | The setup link |
|---|---|---|
| Railway | the project's service → Variables → LEAFEN_SETUP_CODE | the project's service → Variables → open LEAFEN_SETUP_LINK; without the template's variables, Deployments → the latest deployment → Deploy Logs |
| PikaPods | the pod's settings → Env Vars → LEAFEN_SETUP_CODE | the pod's card → More → Show Logs |
| Elestio | the service's overview → Update config (the .env file) → LEAFEN_SETUP_CODE | the service's overview → View app logs |
| Any other | wherever the platform lists a service's environment variables | leafen setup link in the service's shell, or the platform's screen that shows what the service printed |
An agent with access to the platform (its CLI or API) can be asked for the
link: "Get me my Leafen setup link." It can first read
GET <address>/api/leafen/v1/setup/status, which takes no login: from
outside, before the first administrator, codeGiven says the server was
started with LEAFEN_SETUP_CODE and platform names the platform where
Leafen knows it (railway); the table above says where each is, as Railway's
CLI shows the variables (railway variables). The code and the link
are the person's alone. Once the first administrator exists,
neither opens the setup again; a lost device or password is recovered as
Self-hosting says,
with leafen commands run in the platform's shell for the service where it
has one.
Platforms that share revenue with authors (as of 2026-10-17)
| Platform | What the author gets | How to join |
|---|---|---|
| Railway | 15% of the usage cost of deployments from a published template, plus 10% for answering questions in its Template Queue (25% in all); paid in Railway credits or, by choice, cash through Stripe Connect in $100–$10,000 withdrawals (docs) | publish the template to Railway's marketplace from a Railway account |
| PikaPods | a share of the revenue from hosting the app, at a rate PikaPods doesn't publish; not offered for every project | ask PikaPods to list the app and set up the share |
| Elestio | Elestio states 10% of revenue goes to the open-source projects it manages (an older page says 5%), for authors who partner with it | contact Elestio to partner and set up payment |
Railway's template is published. PikaPods and Elestio are not set up yet; their accounts and payout details are the project owner's to set up.