Deploy OpenCode 2 (web + phone)
Always-on OpenCode 2 for your browser and phone, with git and GitHub ready.
OpenCode
Just deployed
/root
Deploy and Host OpenCode 2 (web + phone) on Railway
OpenCode is the open-source AI coding agent. This template runs OpenCode 2 from its official image, always on, so you can start a task on your laptop and follow it on your phone.

About Hosting OpenCode 2 (web + phone)
Choose a password on the deploy form. Open the service's URL, tap Use password, enter it and tap Connect. On a phone, add the page to your home screen. Git, gh and bash come installed; sessions, sign-ins and files stay on a volume.
Connect a model
- Paste an Anthropic, OpenAI or OpenRouter key on the deploy form, or connect a provider later with Connect an integration in OpenCode.
- ChatGPT plan: connect OpenAI and choose Codex device code (legacy). Sign in with ChatGPT works only when OpenCode runs on your own computer.
- GitHub Copilot: connect GitHub Copilot and enter the code it shows at github.com.
- Claude Pro or Max: OpenCode uses them only through Claude Code (its Claude Agent provider), which this template doesn't include. Use an Anthropic API key.
- OpenCode's free models need no key, but they are rate-limited per network address and Railway's addresses are shared. If you see "Free usage limit reached", connect a provider.
Work on your GitHub repos
- Paste a GitHub token into
GITHUB_TOKENon the deploy form: git andghsign in with it, and commits carry your GitHub name. - Set
GIT_REPOtoowner/nameto clone that repo into the workspace on first start. - Need more tools, such as Node.js or Python? List Alpine packages in
EXTRA_PACKAGES(for examplenodejs npm python3); they are installed at every start.
Connect from your laptop
- With OpenCode 2 installed, run
OPENCODE_PASSWORD=yourpassword opencode --server https://your-app.up.railway.appusing your password and URL. - In OpenCode Desktop, choose Add server and enter the same URL and password.
Common Use Cases
- Run coding tasks while you're away
- Check on your agent from your phone
- Fix GitHub issues from anywhere
Dependencies for OpenCode 2 (web + phone) Hosting
- OpenCode
- Volume at /root
Deployment Dependencies
Implementation Details

Back up the volume: it holds your sessions, sign-ins and workspace. It idles at about 0.35 GB and ran a real agent task within the Free plan's 0.5 GB; builds and tests need more.
Why Deploy OpenCode 2 (web + phone) 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 OpenCode 2 (web + phone) 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.
Updated 2026-10-30: First release, OpenCode 2.2.4.
Template Content
OpenCode
ghcr.io/anomalyco/opencode:2.2.4OPENCODE_PASSWORD
Your sign-in password for the web app, OpenCode Desktop and the terminal (8 characters or more). OpenCode will not start without it. To change it later, change it here and redeploy.

