---
title: "Deploy Opencode Server"
description: "Opencode fully featured server for AI Agents. Web desktop & server mode."
category: "AI/ML"
url: https://railway.com/deploy/opencode-server
---

# Deploy Opencode Server

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

**[Deploy Opencode Server on Railway](https://railway.com/template/opencode-server)**

- **Creator:** Sprisa Inc
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### Opencode Server https://pub-6fb5f1860061469da0fd642d6d3a2bbd.r2.dev/opencodelogo2.png

- **Image:** sprisa/opencode:latest
- **Health check:** /site.webmanifest
- **Public domain:** Yes

## Documentation

# Deploy and Host Opencode Server on Railway

Host your own cloud opencode sandbox.   
Ubuntu based minimal Opencode Server deployment. Supports web desktop &amp; 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

| Layer | Details |
|---|---|
| **Base OS** | ubuntu:26.04 |
| **User** | `opencode` (uid/gid 1000), passwordless sudo |
| **opencode** | Pinned in `version.txt` as `OPENCODE_VERSION` build arg |
| **Lazy Installed Tools** | Node, Python3 (see below) |
| **Homebrew** | Linux-native Homebrew (`/home/linuxbrew/.linuxbrew`) — `brew` on PATH |
| **zerobrew** | Faster Homebrew alternative (`zb` on PATH) -- used as mise backend for lazy-installed tools |
| **mise** | Dev tool manager — tools listed below install on first use via `zerobrew` backend |
| **CLI utilities** | git, curl, less, unzip |
| **Init** | tini as PID 1 (zombie reaping, clean shutdown) |

### Lazy-installed tools

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

| Tool | Command | Backend |
|---|---|---|
| GitHub CLI | `gh` | github |
| jq | `jq` | github |
| GitLab CLI | `glab` | zerobrew |
| Ruby | `ruby` | zerobrew |
| ripgrep | `rg` | github |
| fd | `fd` | github |
| Wget | `wget` | zerobrew |
| Vim | `vim` | zerobrew |
| Micro | `micro` | github |
| Nano | `nano` | zerobrew |
| Python 3 | `python3` | zerobrew |
| Node.js | `node` | core |
| Sapling | `sl` | github |

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.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/opencode-server
