Railway

Deploy Opencode Server

Opencode fully featured server for AI Agents. Web desktop & server mode.

Deploy Opencode Server

Opencode Server

sprisa/opencode:latest

Just deployed

/home/opencode

Deploy and Host Opencode Server on Railway

Host your own cloud opencode sandbox.
Ubuntu based minimal Opencode Server deployment. Supports web desktop & server mode with 10+ tools out of the box.

https://github.com/sprisa/opencode-server

About Hosting Opencode Server

Fully featured image for running Opencode agent machines in a Docker or Kubernetes environment. The agent can install it's own tools on demand with mise.

Recommended to create 1 machine / template per user.

Recommended to enable CDN caching for faster load times.

Common Use Cases

  • Your own opencode sandbox
  • Run your agents 24/7
  • Isolated machine
  • Auto stop and persistent volume support

Dependencies for Opencode Server Hosting

0.3 cpu / 2GiB ram minimal .

2 cpu / 4GiB ram recommend.

Deployment Dependencies

None.

Implementation Details

What's inside

LayerDetails
Base OSubuntu:26.04
Useropencode (uid/gid 1000), passwordless sudo
opencodePinned in version.txt as OPENCODE_VERSION build arg
Lazy Installed ToolsNode, Python3 (see below)
HomebrewLinux-native Homebrew (/home/linuxbrew/.linuxbrew) — brew on PATH
zerobrewFaster Homebrew alternative (zb on PATH) -- used as mise backend for lazy-installed tools
miseDev tool manager — tools listed below install on first use via zerobrew backend
CLI utilitiesgit, curl, less, unzip
Inittini as PID 1 (zombie reaping, clean shutdown)

Lazy-installed tools

These tools install on first use (via mise → github/zerobrew):

ToolCommandBackend
GitHub CLIghgithub
jqjqgithub
GitLab CLIglabzerobrew
Rubyrubyzerobrew
ripgreprggithub
fdfdgithub
Wgetwgetzerobrew
Vimvimzerobrew
Micromicrogithub
Nanonanozerobrew
Python 3python3zerobrew
Node.jsnodecore
Saplingslgithub

The image ships with a system config at /etc/mise/config.toml with these pre-approved tools. Users can add or override tools by creating ~/.config/mise/config.toml — mise merges both.

Runtime notes

  • The opencode user has passwordless sudo, so you can su - opencode -c 'apt install ' inside the container.
  • The root filesystem is ephemeral; mount /home/opencode as the persistent volume for all user data (dotfiles, config, projects). The ~/workspace subdirectory is the default workdir.
  • ~/.local/bin is on PATH and user-writable, useful for dropping custom tools at runtime.
  • Node version can be switched at runtime with n (e.g. n lts).
  • Homebrew is installed under /home/linuxbrew/.linuxbrew (outside the persistent volume). It uses its bundled portable Ruby — no system Ruby needed.
  • Zerobrew (zb) is installed at /usr/local/bin/zb with its prefix at ~/.local/share/zerobrew/prefix on PATH for accessing formula binaries.
  • Lazy-installed tools (see table above): run any listed tool and mise auto-installs it via zerobrew or github backend on first use. The image ships defaults in /etc/mise/config.toml; create ~/.config/mise/config.toml to add your own — mise merges both.

Why Deploy Opencode Server 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 Server 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

Opencode Server

sprisa/opencode:latest

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
113
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
1
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
56