Deploy Factory on Rails
Self-hosted coding agents that turn tasks into pull requests
Just deployed
runner
Just deployed
Just deployed
/var/lib/postgresql/data
harness
Just deployed
Deploy and Host Factory on Rails on Railway
Factory on Rails is a self-hosted software factory. Sign in with GitHub, pick a repository, describe a change, and a coding agent (Claude Code or Codex) does the work in its own Railway sandbox and opens a pull request. Follow it live, answer its questions, and keep the conversation going.
About Hosting Factory on Rails
The template deploys four services wired over Railway's private network: the web UI (the only public service), an API and auth service, a runner that drives one sandbox per run, and Postgres. Encryption and signing keys are generated for you. Railway asks for one value, your GitHub username. On first visit, a setup page creates the GitHub App from a manifest (no credentials to copy) and, with a Railway token you paste once, creates the separate agents environment the sandboxes run in. Each user brings their own model credential; sandbox usage is billed to your Railway workspace.
Common Use Cases
- Hand well-defined changes to a coding agent and review them as pull requests
- Run several agents in parallel, each isolated in its own sandbox, with CI fixed automatically when checks fail
- Give a team one place to queue agent work against its repositories, with their own MCP tools
Dependencies for Factory on Rails Hosting
- A GitHub account (the setup page creates the GitHub App used for sign-in and pushes)
- A model credential per user: a Claude subscription token, an Anthropic API key, a ChatGPT sign-in, or an OpenAI API key
- Railway Sandboxes, in the same workspace
Deployment Dependencies
- Source: https://github.com/shixzie/factory-on-rails
- Railway Sandboxes: https://docs.railway.com/sandboxes
Implementation Details
After deploying, open the web service's URL. It takes you to /setup, which walks you through three steps:
- Create the GitHub App and install it on your repositories.
- Sign in with GitHub.
- Paste a Railway account or workspace token so the factory can create its sandbox environment. The token is used once and never stored.
Previews of apps running in sandboxes are optional and need a wildcard domain; see the repository README.
Why Deploy Factory on Rails 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 Factory on Rails 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
runner
shixzie/factory-on-railsharness
shixzie/factory-on-railsALLOWED_GITHUB_LOGINS
Your GitHub username (comma-separate several). Only these accounts can sign in, and the GitHub App must belong to one.
