Deploy Claude Code UI
CloudCLI: Claude Code, Codex and OpenCode in the browser, with a login
Just deployed
Deploy and Host Claude Code UI on Railway
CloudCLI, also known as Claude Code UI, is a web and mobile interface for coding agents. You chat with Claude Code, Codex or OpenCode in a project, browse and edit its files, review git changes, and pick up any earlier session, from a laptop or a phone. This template runs CloudCLI 1.37.4 on a server with the Claude Code, Codex and OpenCode CLIs installed and a login set at deploy.
About Hosting Claude Code UI
CloudCLI is single-user, and on a fresh install the first person to open it creates the account. On a public URL that would be whoever finds it first. So on first start the template runs CloudCLI on localhost only, creates the account from CLOUDCLI_USERNAME and the generated CLOUDCLI_PASSWORD, stops it, and only then opens the public port. In my test CloudCLI reported the account as already set up before anyone had opened the page.
It runs as a normal user rather than root, since Claude Code won't run some modes as root. The whole home directory (/home/node) is a volume: CloudCLI's account database, the CLIs' logins, settings and sessions, and your projects under ~/projects survive redeploys. The image is full Debian with Node.js 22, git and build tools, because the agents build and run code there.
To use a Claude or ChatGPT subscription, open CloudCLI's shell, run claude or codex and sign in once; the login is saved on the volume. API keys work too: set ANTHROPIC_API_KEY or OPENAI_API_KEY on the service, or the variable your OpenCode provider reads, such as OPENROUTER_API_KEY.
Before publishing I tested it on Railway. The account existed before the first visit, and signing in with the generated password worked. I created an API key in CloudCLI's settings and used its agent API to give OpenCode a task on gpt-5-mini through OpenRouter: create hello.txt containing "Railway 42". It finished in 12 seconds, and reading the file back through CloudCLI's file API returned exactly that text. After a restart, sign-in, the project and the file were all still there. I didn't run Claude Code or Codex end to end (I had no keys for them in the test); both are installed, at 2.1.295 and 0.162.0, with OpenCode 1.18.35.
Idle, it used 0.08 to 0.15 GB of RAM, around $1 a month on Railway's usage pricing. An agent at work uses more while it runs.
Common Use Cases
- Running Claude Code or Codex from your phone on a server that keeps going after you close the tab
- One place for every agent session on your projects, with the files and git changes next to the chat
- Triggering agent tasks from n8n, scripts or CI through CloudCLI's agent API with an API key
Dependencies for Claude Code UI Hosting
A Claude or ChatGPT account, or an API key for the agent you want to use.
Deployment Dependencies
- CloudCLI: https://github.com/siteboon/claudecodeui
- Docs: https://cloudcli.ai/docs
- The wrapper this template builds: https://github.com/dektionstudio/railway-template-images/tree/main/cloudcli
Implementation Details
CLOUDCLI_URL # open this
CLOUDCLI_USERNAME / CLOUDCLI_PASSWORD # the account created on first start
/home/node # the volume: account, CLI logins and sessions, ~/projects
CLOUDCLI_PASSWORD is only read on the first start. To change the password later, do it in CloudCLI's settings. Packages installed with apt go away on the next redeploy, because only the home directory persists. CloudCLI is AGPL-3.0 licensed, and its makers also sell a hosted version at cloudcli.ai.
Why Deploy Claude Code UI on Railway?
Your agents run on a server instead of your laptop, behind a login, with their work on a volume. Railway bills the RAM the container uses, which is little while it waits for you.
Template Content
