Skip to content

Deploy it

Deploying a Kywi app is a Next build plus a Postgres, with one rule — migrations are run by hand, never as a pre-deploy hook.

A Kywi deploy is an ordinary Next build and start against a Postgres database — there is no separate Kywi runtime to install. Set the start command explicitly rather than trusting the platform's default: on Railway, no start command left Railpack running pnpm start, and pnpm treats a child process ended by SIGTERM as a failed script and exits 1 — so every deploy reported a crash on the otherwise-healthy container it was replacing. The fix was a literal node_modules/.bin/next start.

Two environment variables the app refuses to boot without

DATABASE_URL and AUTH_SECRET both have to be set before the app will start in production — it refuses to boot without either one, and this project's own first deploy failed on AUTH_SECRET, before the variable existed. Surface 8 covers the full environment, four variables in total; see Deploying a host app for the other two, and AUTH_SECRET and the production fail-fast for what the failure looks like.

Migrations are never a pre-deploy hook

One more thing that catches people out on the same platform: a redeploy re-uses the previous deployment's frozen settings, so it will re-run a pre-deploy hook you have since removed from the service configuration. After changing service settings, trigger a fresh source deploy — or push a commit — instead of redeploying the old one.

Where the rest of this lives

The specifics above — the start-command fix, the cancelled deployment, the frozen-settings redeploy — describe Railway, the one platform this project has actually deployed to and verified. Nothing here claims to generalize to another host.