Skip to main content
Version: 2.x (Latest)

Deploy on Railway

Introduction

Railway is a deployment platform where you can provision infrastructure, develop locally, and deploy to the cloud.

Requirements

A Railway account.

Deploy an Authorizer Instance

Deploy a production-ready Authorizer instance with PostgreSQL and Redis:

Deploy on Railway

Before getting started, make sure you have given permission to Railway for further deployments as it will create a repository in your GitHub account.

Railway deployment

Configure for v2

After deployment, configure the following required variables in Railway's environment settings:

VariableExample Value
DATABASE_TYPEpostgres
DATABASE_URL(auto-configured by Railway)
JWT_TYPEHS256
JWT_SECRETtest
ADMIN_SECRETadmin
CLIENT_ID123456
CLIENT_SECRETsecret

Optional: metrics bind address and rate limits

The authorizer-railway Dockerfile maps these environment variables to CLI flags (defaults match the Authorizer binary):

VariableMaps toDefaultWhen to set
METRICS_HOST--metrics-host127.0.0.1Use 0.0.0.0 only if something on the same private network must scrape METRICS_PORT (never expose metrics on the public internet).
METRICS_PORT--metrics-port8081Change if the platform collides with this port.
RATE_LIMIT_RPS--rate-limit-rps30Lower for stricter protection or raise for busy UIs; 0 disables.
RATE_LIMIT_BURST--rate-limit-burst20Short spike allowance per IP.
RATE_LIMIT_FAIL_CLOSED--rate-limit-fail-closedfalseSet true to return 503 when the rate-limit backend (e.g. Redis) errors instead of fail-open.

Set REDIS_URL when you use multiple instances so sessions and rate limits stay consistent (rate limiting).

Update the start command to pass CLI flags:

./build/server \
--database-type=$DATABASE_TYPE \
--database-url=$DATABASE_URL \
--jwt-type=$JWT_TYPE \
--jwt-secret=$JWT_SECRET \
--admin-secret=$ADMIN_SECRET \
--client-id=$CLIENT_ID \
--client-secret=$CLIENT_SECRET

Update Instance

Update the Docker image to the desired version in the repository created with your deployment.

Find all versions on GitHub or Docker Hub.