Deploy Open Splitwise
Self-hosted Splitwise companion with PostgreSQL and Cloudflare Tunnel.
open-splitwise
Just deployed
cloudflared
Just deployed
Just deployed
/var/lib/postgresql/data
Deploy and Host Open Splitwise on Railway
Self-hosted Splitwise companion: sync expenses locally, then search, filter, and chart your data. Settling up still happens in Splitwise.
About Hosting
This template provisions PostgreSQL, the open-splitwise Next.js app, and a cloudflared sidecar in one Railway project. The app builds from the repo Dockerfile; the tunnel builds from deploy/cloudflared.
Why Deploy
- Keep a private copy of your Splitwise expenses for search, filters, CSV export, and charts
- Multi-tenant: several Splitwise accounts can share one deployment with isolated data
- Expose the app via Cloudflare Tunnel (outbound-only) instead of a public Railway URL
Common Use Cases
- Personal expense exploration and insights beyond the Splitwise mobile app
- Self-hosted analytics for shared households or roommates
- Production on Railway behind a custom Cloudflare hostname (full tunnel guide)
Dependencies for
Deployment Dependencies
| Service | Notes |
|---|---|
| Postgres | Private network; DATABASE_URL wired automatically |
| open-splitwise | GitHub repo ankitchouhan1020/open-splitwise |
| cloudflared | Same repo, deploy/cloudflared — needs TUNNEL_TOKEN |
You must provide:
TUNNEL_TOKEN— Cloudflare Zero Trust → Networks → Tunnels → Configure → Install connectorSPLITWISE_CLIENT_IDandSPLITWISE_CLIENT_SECRETfrom secure.splitwise.com/apps- Cloudflare tunnel public hostname →
open-splitwise.railway.internal:3000(see cloudflare-tunnel.md) - Set
APP_URLandSPLITWISE_REDIRECT_URIto your Cloudflare hostname (not*.up.railway.app)
After deploy: remove public Railway domains from the app service if using the tunnel only → Settings → Connect Splitwise → Sync.
Template Content
open-splitwise
ankitchouhan1020/open-splitwisePORT
APP_URL
HOSTNAME
NODE_ENV
SESSION_SECRET
NEXT_PUBLIC_APP_URL
SPLITWISE_CLIENT_ID
SPLITWISE_REDIRECT_URI
SPLITWISE_CLIENT_SECRET
cloudflared
ankitchouhan1020/open-splitwiseTUNNEL_TOKEN
PGDATA
PGPORT
POSTGRES_DB
POSTGRES_USER
SSL_CERT_DAYS
RAILWAY_DEPLOYMENT_DRAINING_SECONDS
