Skip to content

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

  1. Step 1: New Project > Empty project.

  2. Step 2: + Create > Database > Add PostgreSQL.

  3. Step 3: + Create > Database > Add Redis.

  4. Step 4: + Create > Docker Image > ghcr.io/evergreen-it-dev/folio:latest. Name the service folio.

  5. Step 5: In the folio service open Variables and add the ones from the table below.

  6. Step 6: Settings > Networking > Generate Domain, with port 4870.

  7. Step 7: Right-click the service (or Settings > Volumes) > Attach volume, mount path /app/data.

  8. Step 8: Settings > Deploy > Healthcheck Path: /api/health.

  9. 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.

Environment variables for Folio on Railway
VariableValueWhat it does
NODE_ENVproductionRuns the app in production mode.
PORT4870The port the app listens on, and the one Railway routes to.
ASSET_BACKENDlocalUploads go to the volume.
DATABASE_URL${{Postgres.DATABASE_URL}}Reference variable.
REDIS_URL${{Redis.REDIS_URL}}Reference variable.
PUBLIC_URLhttps://${{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_DOMAINSempty, optionalTurn on "Sign in with Google".
CURSOR_API_KEYempty, optionalShared 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:

bash
railway run --service Postgres sh -c 'pg_dump "$DATABASE_PUBLIC_URL"' > folio-db.sql

DATABASE_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.

bash
node deploy/smoke.mjs https://wiki.example.com

Other ways to install

Compare all platforms

Not 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.

Open the demo