Star
Deployment

Deploy on Railway

Railway runs your service with Postgres and Redis in the same project.

1. Your repo

Railway deploys your own repo, not notifkit's. It needs the server.ts and Dockerfile from the overview, and a package.json whose build script outputs dist/server.js. Railway builds with the Dockerfile when it finds one.

2. Add Postgres and Redis

Create a project from your GitHub repo. Then add a PostgreSQL database and a Redis database with + New → Database.

3. Set the variables

On your notifkit service:

VariableValue
NODE_ENVproduction
HOST0.0.0.0
DATABASE_URL${{Postgres.DATABASE_URL}}
REDIS_URL${{Redis.REDIS_URL}}?family=0. family=0 lets ioredis use Railway's IPv6 private network
PUBLIC_URLhttps://${{RAILWAY_PUBLIC_DOMAIN}}
UNSUBSCRIBE_SECRET16+ random characters. Never rotate it
ADMIN_API_KEYYour bootstrap key
RAILWAY_DEPLOYMENT_DRAINING_SECONDS45, so in-flight sends finish before Railway stops the old deploy

Leave PORT unset. Railway sets it.

4. Settings

  • Networking: generate a public domain.
  • Deploy → Healthcheck Path: /ready.

5. Create a project

curl -s -X POST https://YOUR-APP.up.railway.app/v1/projects \
  -H "Authorization: Bearer $ADMIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"production"}'

More than one replica

One replica migrates the database on start. With more, set autoMigrate: false and set the service's Pre-deploy Command to npx notifkit-migrate.

Need help?

Stuck, or want us to deploy it for you? Email [email protected].