Deploy Gitterm

Your Personal Cloud and Local OpenCode Instance Orchestrator

Deploy Gitterm

Proxies

gitterm-tunnel-proxy

opeoginni/gitterm-tunnel-proxy

Just deployed

gitterm-caddy-proxy

opeoginni/gitterm-proxy

Just deployed

Database

Just deployed

/data

/var/lib/postgresql/data

Just deployed

Just deployed

Just deployed

gitterm-idle-reaper-worker

opeoginni/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

Environment Variables

Required

VariableDescription
AGENT_JWT_SECRETSecret for agent authentication JWTs
INTERNAL_API_KEYShared key for service-to-service communication
ENABLE_EMAIL_AUTHEnable email/password authentication (true/false)
TUNNEL_JWT_SECRETSecret for tunnel authentication JWTs
BETTER_AUTH_SECRETAuth secret (generate with: openssl rand -base64 32)
ENABLE_GITHUB_AUTHEnable GitHub OAuth (true/false)
ENABLE_IDLE_REAPINGAuto-cleanup idle workspaces (true/false)
ENABLE_LOCAL_TUNNELSEnable local tunnel feature (true/false)

Optional

VariableDescription
ADMIN_EMAILBootstrap admin user email on first startup
ADMIN_PASSWORDBootstrap admin user password
RAILWAY_API_TOKENToken for Railway API access (for cloud instances)
RAILWAY_PROJECT_IDProject ID for Railway deployments
PUBLIC_RAILWAY_DOMAINSMake Railway instances publicly reachable (true/false)
RAILWAY_DEFAULT_REGIONDefault region for deployments
RAILWAY_ENVIRONMENT_IDEnvironment ID for Railway

Conditional Variables

If ENABLE_GITHUB_AUTH=true:

  • GITHUB_CLIENT_ID - GitHub OAuth app client ID
  • GITHUB_CLIENT_SECRET - GitHub OAuth app client secret

Worker Cron Jobs

GitTerm requires two cron jobs for the worker services:

WorkerSchedulePurpose
idle-reaper*/10 * * * * (every 10 minutes)Stops idle workspaces and enforces quotas
daily-reset0 0 * * * (daily at midnight UTC)Logs daily usage statistics

Important: You must set up both cron jobs in Railway:

  1. Idle Reaper Cron Job

    • Schedule: */10 * * * *
    • Runs every 10 minutes to check for idle workspaces
    • Controlled by ENABLE_IDLE_REAPING environment variable
  2. Daily Reset Cron Job

    • Schedule: 0 0 * * *
    • Runs once daily at midnight UTC for usage statistics

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

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

View Template
peppermint
Docker-compose port for peppermint.sh