---
title: "Deploy OpenCode WebUI Workspace | (Just Updated) AI Coding Agent in Browser, 1GB+ RAM"
description: "OpenCode AI coding agent in your browser: Python, Node, Go, Rust. 1GB+ RAM"
category: "Automation"
url: https://railway.com/deploy/opencode-webui-workspace
---

# Deploy OpenCode WebUI Workspace | (Just Updated) AI Coding Agent in Browser, 1GB+ RAM

OpenCode AI coding agent in your browser: Python, Node, Go, Rust. 1GB+ RAM

**[Deploy OpenCode WebUI Workspace | (Just Updated) AI Coding Agent in Browser, 1GB+ RAM on Railway](https://railway.com/template/opencode-webui-workspace)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/opencode-webui-workspace/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Automation
- **Total deploys:** 71

## Template content

### opencode

- **Image:** ghcr.io/bon5co/opencode-webui-workspace:latest
- **Public domain:** Yes

## Documentation

# Deploy and Host OpenCode WebUI Workspace on Railway

OpenCode, the open-source AI coding agent, in your browser: a password-protected web UI plus a full dev box with Python, Node.js, Bun, Go and Rust, on a persistent volume. Bring your own model provider key (Anthropic, OpenAI, OpenRouter and the rest OpenCode supports).

## Requirements: 1 GB RAM or more (Hobby plan)

Measured on 2026-11-06 against this exact image:

- Idle after boot: about 200 MB.
- One small agent task (write a file, run it): peaks at **711 MB**.
- In a 512 MB container (the Free plan limit) the whole container was OOM-killed on the first agent action in both test runs. Capping the runtime's garbage collector does not prevent it.

So this template **will not work on the Free plan**, and Trial (1 GB) only fits light use. Deploy on Hobby. Compiling Rust or Go inside the workspace needs more memory still, so raise the service limit if you build large projects.

## What is OpenCode WebUI Workspace?

OpenCode is an open-source AI coding agent. This template runs `opencode web`, its browser interface, inside an Ubuntu 24.04 development container with:

- Python 3.13 and uv
- Node.js LTS and npm
- Bun
- Go
- Rust and Cargo
- git, build-essential, jq, tmux, rclone, magic-wormhole

The image is rebuilt every day from upstream, so the OpenCode release you get is current.

## About Hosting OpenCode WebUI Workspace

The service serves the web UI and OpenCode's HTTP API on port 4096 behind HTTP basic auth. The username is `sloth`; the password is generated per deploy into `OPENCODE_SERVER_PASSWORD` (open the service's Variables tab to read it). Your projects live in `/home/opencode/workspace`, which is a Railway volume, so they survive redeploys and restarts.

### Agent contract

- Public URL: `https://$RAILWAY_PUBLIC_DOMAIN` (web UI and HTTP API)
- Private URL: `http://opencode.railway.internal:4096`
- Credentials: `OPENCODE_SERVER_USERNAME`, `OPENCODE_SERVER_PASSWORD`
- Auth: HTTP basic auth on every route, including health
- Health: `GET /global/health` returns 200 `{"healthy":true,...}` with basic auth
- Persistent path: `/home/opencode/workspace`

```bash
# Run with the deploy's public domain and the two variables above.
H="https://$RAILWAY_PUBLIC_DOMAIN"
AUTH="$OPENCODE_SERVER_USERNAME:$OPENCODE_SERVER_PASSWORD"
curl -fsS -u "$AUTH" "$H/global/health"
SID=$(curl -fsS -u "$AUTH" -H 'content-type: application/json' -X POST -d '{}' "$H/session" | sed 's/.*"id":"\([^"]*\)".*/\1/')
curl -fsS -u "$AUTH" "$H/session/$SID"
```

To send prompts, add a provider key first (web UI settings, or the provider's environment variable such as `ANTHROPIC_API_KEY` on the service), then `POST $H/session/$SID/message` with a `parts` array. OpenCode's built-in free models are rate-limited per IP and answered `Free usage exceeded` from Railway's shared egress when tested on 2026-11-06, so do not rely on them here.

## Transferring files in and out

Ask the agent to use magic-wormhole or rclone, or run them yourself in the workspace terminal:

```bash
# Local machine: send a file
wormhole send myfile.zip            # prints a code such as 7-crossword-pandora
# In the workspace: receive it
wormhole receive 7-crossword-pandora
```

rclone covers S3, Google Drive, Dropbox and others: `rclone config` once, then `rclone copy`.

## Common Use Cases

- **AI coding from any device**: drive a coding agent from a phone, tablet or laptop browser, with the code on a server that stays up.
- **Disposable, isolated dev environment**: let the agent install packages and run code with full permissions without touching your own machine.
- **Agent-to-agent automation**: other agents or CI jobs create sessions and send prompts over the HTTP API shown in the Agent contract.

## Dependencies for OpenCode WebUI Workspace Hosting

- One Railway service built from `ghcr.io/bon5co/opencode-webui-workspace:latest`
- One volume at `/home/opencode/workspace`
- A Railway plan with at least 1 GB RAM per service (Hobby recommended)

### Deployment Dependencies

- [Image source: bon5co/opencode-webui-workspace](https://github.com/bon5co/opencode-webui-workspace)
- [OpenCode](https://opencode.ai)
- [OpenCode server API docs](https://opencode.ai/docs/server/)

## Why Deploy OpenCode WebUI Workspace 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 WebUI Workspace 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

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

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