Railway (recommended)
Railway is the recommended production host for Cognisafe. Each service is deployed as an independent Railway service from this monorepo, giving you per-service scaling, logs, and metrics.One-time setup
1
Create a Railway project
Go to railway.app and create a new project.
2
Add managed services
In your Railway project, add:
- PostgreSQL — use the TimescaleDB plugin
- Redis — standard Redis service
3
Create the four application services
Create one Railway service per component. Use the settings from the table below:
4
Set environment variables
Configure the env vars for each service as shown in the sections below.
5
Connect your GitHub repo
In Railway: Settings → Source → connect your GitHub repository. Set the target branch (
main or platform). Railway redeploys all services on every push to that branch.Environment variables per service
api
proxy
web
safety_worker
Custom domains
In Railway: Settings → Networking → Generate Domain (or add your own CNAME). Recommended mapping:Scaling
Scale thesafety_worker service by increasing its replica count in Railway’s service settings. The workers are stateless — each reads independently from the Redis queue.
Bare Kubernetes (Helm)
A Helm chart is available for teams running their own Kubernetes cluster.Deployment resources, plus Service and Ingress objects. PostgreSQL and Redis are expected to be provided externally (managed cloud databases or separate Helm releases).
Values reference
Running migrations on Kubernetes
The Helm chart includes a pre-upgradeJob that runs alembic upgrade head:

