Deploying to a platform
Ready-made setups for hosting platforms, each with slonbase and a PostgreSQL database. They all
use the image from ghcr..
The templates use the latest image. To control upgrades, pin a release (:2.) instead.
Disks owned by root. Render, Railway and Fly.io mount their disks at / owned by root.
The image runs as an unprivileged user, which can start but can't write files there, so file
uploads would fail. The setups below run the container as root on those platforms
(deploy/, deploy/, RAILWAY_RUN_UID=0). Coolify and Dokploy
use Docker volumes, which keep the image's ownership, so the image runs unchanged there.
#Render
The button reads render.. It creates:
- a web service on the Starter plan, with a 1 GB disk at
/anddata /as its health check;api/ health - a PostgreSQL 17 database that only the service can reach, with its connection string passed to
the service as
SLONBASE_DATABASE_URL.
Disks need a paid instance. To use the free plan, remove the disk section and keep files on S3
(Settings → Files storage). Without a disk, hooks and local backups don't survive a redeploy.
Once it's live, find the setup link in the service's Logs. It shows http:/;
replace that with the service's https:/ address.
#Railway
Create a project and add PostgreSQL (+ New → Database → PostgreSQL).
Add the app: + New → Docker Image →
ghcr..io/ ayeshrodz/ slonbase:latest In the app's Variables, add:
Variable Value SLONBASE_DATABASE_URL${{ Postgres. DATABASE_URL}} PORT8090RAILWAY_RUN_UID0(see disks owned by root)Attach a volume to the app (right-click it → Attach volume), mounted at
/.data In Settings → Networking, generate a domain for port
8090.
Open the setup link from the app's Deploy Logs, replacing http:/ with the
generated domain.
#Fly.io
deploy/ has a fly. and a two-line Dockerfile that runs the
image as root. The fly. sets up one machine with a 1 GB volume at / and a health
check on /.
mkdir slonbase-fly && cd slonbase-fly
curl -fsSLO https://raw.githubusercontent.com/ayeshrodz/slonbase/main/deploy/fly/fly.toml
curl -fsSLO https://raw.githubusercontent.com/ayeshrodz/slonbase/main/deploy/fly/Dockerfile
fly launch --copy-config --no-deploy # pick an app name and a regionFor the database, use Fly Managed Postgres (fly mpg create) or any
PostgreSQL 14+ server. Then pass the database's connection string and a setup token, and deploy:
fly secrets set SLONBASE_DATABASE_URL='postgres://…' SLONBASE_SETUP_TOKEN="$(openssl rand -hex 24)"
fly deployFinish at https:/.
Keep it to one machine: the volume belongs to a single machine. To run several instances, keep files on S3 and drop the volume (see several instances).
#Coolify
Use deploy/: + New → Resource →
Docker Compose Empty, then paste the file. Coolify generates the database credentials, a 64
character setup token and a URL. Deploy, then open https:/ (see the resource's Environment Variables).
The file follows Coolify's one-click service template format, so it can be added to Coolify's catalog (see deploy/README.md for submitting it).
#Dokploy
deploy/ has a docker-compose. and a template. in the
format of Dokploy's template catalog. Without the catalog:
- Create a service → Compose, and paste
docker-compose..yml - Under Environment, set
DB_PASSWORDandSETUP_TOKEN. Use letters and digits, and make the token at least 32 characters (openssl rand -hex 24gives both). - Under Domains, add your domain, with service
slonbaseand port8090. - Deploy, then open
https:/./ <domain>/ _/ setup?token=<SETUP_TOKEN>
#After the first deploy
In the dashboard's Settings:
- Application URL: set it to the public
https:/address. Emails link to it./ - Trusted proxy: every platform here puts a proxy in front of slonbase. Without this setting,
logs, rate limits and
superuserIPssee the proxy's address instead of the client's. Use the header your platform documents for the client's address:Fly-Client-IPon Fly.io, and usuallyX-Forwarded-Forelsewhere (see trusted proxy). - Mail: configure SMTP so verification and password reset emails go out.
Realtime works through all of these platforms' proxies. For backups, the database is the platform's PostgreSQL, so its own backups cover your records. slonbase's scheduled backups (Settings → Backups) also include the files; send them to S3 when the disk isn't backed up.