Install Folio on Railway
You use Railway and want managed PostgreSQL and Redis, with a public HTTPS address for each service. A Railway template would deploy the whole stack from one button; that template does not exist yet.
The button works once the image is published and the Railway template is created.
What you need
- A Railway account on the Hobby plan or higher. The free trial's 0.5 GB volume and RAM are too small.
- The image ghcr.io/evergreen-it-dev/folio, published and public.
Before you start
About the template
A Railway template is created in the account of whoever publishes it, so it does not exist until the Folio maintainers create it. Until then, the steps below build the same project by hand.
Steps
Step 1: New Project > Empty project.
Step 2: + Create > Database > Add PostgreSQL.
Step 3: + Create > Database > Add Redis.
Step 4: + Create > Docker Image > ghcr.io/evergreen-it-dev/folio:latest. Name the service folio.
Step 5: In the folio service open Variables and add the ones from the table below.
Step 6: Settings > Networking > Generate Domain, with port 4870.
Step 7: Right-click the service (or Settings > Volumes) > Attach volume, mount path /app/data.
Step 8: Settings > Deploy > Healthcheck Path: /api/health.
Step 9: Deploy. Open the generated domain. The first account is the administrator.
Settings
Variables of the folio service. The ones with ${{...}} are Railway reference variables.
| Variable | Value | What it does |
|---|---|---|
NODE_ENV | production | Runs the app in production mode. |
PORT | 4870 | The port the app listens on, and the one Railway routes to. |
ASSET_BACKEND | local | Uploads go to the volume. |
DATABASE_URL | ${{Postgres.DATABASE_URL}} | Reference variable. |
REDIS_URL | ${{Redis.REDIS_URL}} | Reference variable. |
PUBLIC_URL | https://${{RAILWAY_PUBLIC_DOMAIN}} | Links in invitations and shares; HTTPS-only cookies. |
FOLIO_SECRET | ${{secret(64, "abcdef0123456789")}} | Generated at deploy time. Never change it afterwards. |
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_ALLOWED_DOMAINS | empty, optional | Turn on "Sign in with Google". |
CURSOR_API_KEY | empty, optional | Shared AI assistant key. |
Update
Open the folio service > Settings > Source and redeploy, or change the image tag (pin v0.1.0 to update on your terms). The app migrates the database when it starts. A redeploy of a service with a volume causes a brief downtime; Railway does that on purpose.
Back up
Railway has volume backups, manual and scheduled, for /app/data. For the database use the Postgres service's backups, or from your machine with the Railway CLI:
railway run --service Postgres sh -c 'pg_dump "$DATABASE_PUBLIC_URL"' > folio-db.sqlDATABASE_PUBLIC_URL exists when the Postgres TCP proxy is enabled.
Limits and honest notes
- Railway bills by use. The stack idles at about 0.5 GB of RAM for the app and a little for each database, plus the volume. Hobby gives a 5 GB volume per service; Pro allows more. Check Railway's pricing for today's numbers.
- One replica only: Railway volumes do not work with replicas.
- Volumes can grow but not shrink.
- If Folio logs [redis] unavailable after the first deploy, Railway's private network may need IPv6: append ?family=0 to the Redis URL (${{Redis.REDIS_URL}}?family=0). Folio keeps working without Redis, with per-process rate limits, but fix it.
Platform documentation
Check the installation
From a clone of the repository, run the smoke test against a fresh instance. It needs Node 18 or newer. It creates the first account, a space and a page, and opens a WebSocket connection to the page. Delete the instance, or that space, afterwards.
node deploy/smoke.mjs https://wiki.example.comOther ways to install
Compare all platformsNot ready to install?
Try the public demo: https://demo.foliowiki.online. Pick Sam on the sign-in screen. The login is shared and the data resets every 24 hours, so don't enter personal data or API keys.