Deploy Gitterm
Your Personal Cloud and Local OpenCode Instance Orchestrator
Proxies
gitterm-tunnel-proxy
Just deployed
gitterm-caddy-proxy
Just deployed
Database
Redis
Just deployed
/data
Just deployed
/var/lib/postgresql/data
gitterm-server
Just deployed
gitterm-web
Just deployed
gitterm-listener
Just deployed
gitterm-idle-reaper-worker
Just deployed
Deploy and Host GitTerm on Railway
GitTerm is a platform for running AI coding agents. It supports cloud workspaces where agents run remotely, and local tunnels to expose your local agent setup through secure URLs. Currently supports OpenCode.
About Hosting GitTerm
GitTerm deploys as a full-stack application with multiple services: a web frontend, API server, tunnel proxy, webhook listener, and background workers. All services route through a single Caddy reverse proxy on one domain using path-based routing (/ws/{workspace-id}/). You'll need PostgreSQL for data and Redis for caching/pub-sub. GitHub OAuth and email auth are supported for authentication.
Common Use Cases
- Self-host your agent infrastructure - Run your own GitTerm instance for personal or team use
- Local tunnel for development - Expose your local coding agent setup to the internet securely
- Multi-tenant deployment - Provide agent hosting services to users with isolated workspaces
Dependencies for GitTerm Hosting
- PostgreSQL (database)
- Redis (caching and pub/sub)
- Custom domain (for Caddy proxy)
Deployment Dependencies
- Railway PostgreSQL
- Railway Redis
- GitHub OAuth App (if enabling GitHub auth)
Environment Variables
Required
| Variable | Description |
|---|---|
AGENT_JWT_SECRET | Secret for agent authentication JWTs |
INTERNAL_API_KEY | Shared key for service-to-service communication |
ENABLE_EMAIL_AUTH | Enable email/password authentication (true/false) |
TUNNEL_JWT_SECRET | Secret for tunnel authentication JWTs |
BETTER_AUTH_SECRET | Auth secret (generate with: openssl rand -base64 32) |
ENABLE_GITHUB_AUTH | Enable GitHub OAuth (true/false) |
ENABLE_IDLE_REAPING | Auto-cleanup idle workspaces (true/false) |
ENABLE_LOCAL_TUNNELS | Enable local tunnel feature (true/false) |
Optional
| Variable | Description |
|---|---|
ADMIN_EMAIL | Bootstrap admin user email on first startup |
ADMIN_PASSWORD | Bootstrap admin user password |
RAILWAY_API_TOKEN | Token for Railway API access (for cloud instances) |
RAILWAY_PROJECT_ID | Project ID for Railway deployments |
PUBLIC_RAILWAY_DOMAINS | Make Railway instances publicly reachable (true/false) |
RAILWAY_DEFAULT_REGION | Default region for deployments |
RAILWAY_ENVIRONMENT_ID | Environment ID for Railway |
Conditional Variables
If ENABLE_GITHUB_AUTH=true:
GITHUB_CLIENT_ID- GitHub OAuth app client IDGITHUB_CLIENT_SECRET- GitHub OAuth app client secret
Worker Cron Jobs
GitTerm requires two cron jobs for the worker services:
| Worker | Schedule | Purpose |
|---|---|---|
| idle-reaper | */10 * * * * (every 10 minutes) | Stops idle workspaces and enforces quotas |
| daily-reset | 0 0 * * * (daily at midnight UTC) | Logs daily usage statistics |
Important: You must set up both cron jobs in Railway:
-
Idle Reaper Cron Job
- Schedule:
*/10 * * * * - Runs every 10 minutes to check for idle workspaces
- Controlled by
ENABLE_IDLE_REAPINGenvironment variable
- Schedule:
-
Daily Reset Cron Job
- Schedule:
0 0 * * * - Runs once daily at midnight UTC for usage statistics
- Schedule:
In Railway, go to your worker service → Settings → Cron Jobs and add both schedules.
Implementation Details
After deployment, add your custom domain to the proxy service. Caddy handles all routing:
# Your domain structure
https://your-domain.com/ → Web dashboard
https://your-domain.com/api/ → API server
https://your-domain.com/ws/{workspace-id}/ → Workspace (cloud or tunnel)
Why Deploy GitTerm on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying GitTerm on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
gitterm-server
ghcr.io/opeoginni/gitterm-serverAGENT_JWT_SECRET
INTERNAL_API_KEY
Key used by other services to talk to the main server.
ENABLE_EMAIL_AUTH
Enable email/password authentication.
TUNNEL_JWT_SECRET
BETTER_AUTH_SECRET
ENABLE_GITHUB_AUTH
ENABLE_IDLE_REAPING
Stop idle workspaces automatically
ENABLE_LOCAL_TUNNELS
Enable local tunnel support.
gitterm-web
OpeOginni/gittermRedis
redis:8.2.1gitterm-tunnel-proxy
ghcr.io/opeoginni/gitterm-tunnel-proxygitterm-listener
ghcr.io/opeoginni/gitterm-listenergitterm-idle-reaper-worker
ghcr.io/opeoginni/gitterm-idle-reaper-workergitterm-caddy-proxy
ghcr.io/opeoginni/gitterm-proxy