Managed platforms (no server)
Run HydroGo on Fly.io, Cloudflare Containers, Render or Railway from one Docker image, with no server to patch.
One image, deploy/paas/Dockerfile, runs on all four platforms. Everything is configured with environment variables. On start the entrypoint fixes volume permissions, generates the production secrets, restores the database from a replica when the disk is empty, runs hydro migrate and creates the first admin on a fresh database.
| Platform | Disk | Notes |
|---|---|---|
| Fly.io | Volume (persistent) | Cheapest always-on option. The machine stops when idle. |
| Cloudflare Containers | Ephemeral | Workers Paid plan, beta. Needs Litestream and R2. |
| Render | Disk (paid instances) | Blueprint file, secrets asked for in the dashboard. |
| Railway | Volume | Add a volume mounted at /app/data. |
What fits where
- Content sites (corporate, blog, news, docs, restaurant): SQLite on a persistent volume, or SQLite replicated to S3/R2 with Litestream when the disk is ephemeral. One app per site.
- Commerce and anything that moves money: use PostgreSQL. Set
HYDRO_DATABASE_DIALECT=postgresandHYDRO_DATABASE_DSN; the entrypoint then skips SQLite and Litestream. Keep media in S3/R2. A volume sits on one host with periodic snapshots, which is not enough for orders and payments. - Many tenants on one deployment: use
tenancywith PostgreSQL, not one app per customer. - Frontend: HydroGo is headless. Host the site on Cloudflare Pages or any static/Node host and point it at the API origin.
Environment
| Variable | Purpose |
|---|---|
HYDRO_HTTP_PUBLIC_ORIGIN | The site's canonical https origin. Falls back to the platform URL on Fly, Render and Railway. |
HYDRO_ADMIN_EMAIL, HYDRO_ADMIN_PASSWORD | First admin, created only on a fresh SQLite database. Keep the password in the platform's secret store. |
HYDRO_JWT_SECRET, RECOVER_SECRET | Generated into the data directory when unset. Set them as secrets on an ephemeral disk, or every restart signs everyone out. |
LITESTREAM_REPLICA_URL | s3://bucket/path. Replicates SQLite every second and restores it on boot. Also LITESTREAM_ACCESS_KEY_ID, LITESTREAM_SECRET_ACCESS_KEY, LITESTREAM_ENDPOINT (R2) and LITESTREAM_REGION. |
HYDRO_MEDIA_STORAGE_DRIVER=s3 | Litestream replicates the database only. On an ephemeral disk keep uploads in S3/R2. |
HYDRO_AUTO_MIGRATE | true by default. Set false to run hydro migrate yourself before each rollout. |
421 to any Host other than its public origin. After you attach a custom domain, set HYDRO_HTTP_PUBLIC_ORIGIN to it; the platform's own hostname then stops working. Use a TCP health check rather than an HTTP one.Fly.io
cp deploy/fly/fly.toml fly.toml
fly launch --no-deploy --copy-config --name my-site --region fra
fly secrets set HYDRO_ADMIN_PASSWORD='...' HYDRO_HTTP_PUBLIC_ORIGIN=https://www.example.com
fly deploy --ha=false
fly certs add www.example.comDeploy exactly one machine: SQLite has a single writer. Fly snapshots the volume daily. Set a spending alert in the Fly dashboard, because usage above the included credit is billed.
Cloudflare Containers
Needs the Workers Paid plan, and Containers are in beta. The Worker in deploy/cloudflare proxies every request to one container and passes every HYDRO_* and LITESTREAM_* variable and secret into it.
cd deploy/cloudflare && npm install
npx wrangler r2 bucket create my-site
npx wrangler secret put HYDRO_ADMIN_PASSWORD
npx wrangler secret put LITESTREAM_ACCESS_KEY_ID
npx wrangler secret put LITESTREAM_SECRET_ACCESS_KEY
npx wrangler secret put HYDRO_JWT_SECRET
npx wrangler deployThe container sleeps after ten idle minutes, so the next request waits for a cold start plus the Litestream restore. The default lite instance has 256 MiB; set CONTAINER_INSTANCE to basic if the process is killed for memory.
Render and Railway
Render: New, then Blueprint, with blueprint path deploy/render/render.yaml, and fill in the admin password. Railway: create a service from the repository, set the config file to deploy/railway/railway.json, add a volume at /app/data, then set HYDRO_ADMIN_EMAIL and HYDRO_ADMIN_PASSWORD.
<app>.fly.dev rather than A/AAAA records: the IP addresses belong to the app and change if it is destroyed and recreated.wrangler deploy --dry-run) are tested locally. Cloudflare Containers, Render and Railway have not been deployed live yet, so report what you hit.