Ubuntu 26.04 SSH + Claude Code + Codex
An always-on Ubuntu 26.04 LTS dev box with SSH and a browser terminal. Claude Code, OpenAI Codex CLI, Gemini CLI and OpenCode are preinstalled, so agents keep working in tmux after you close your laptop. Your home directory and CLI logins sit on a persistent volume.
What you get
- Ubuntu 26.04 LTS image pinned by digest, with tmux, Node.js, Python, uv and build tools
- OpenSSH for the user dev (passwordless sudo, no root login) behind a Railway TCP proxy, with host keys kept on the volume
- A password-protected status page and ttyd browser terminal on the public URL
- Generated SSH_PASSWORD and WEB_PASSWORD; SSH_AUTHORIZED_KEYS supported for key-only access
- A Railway volume at /home for projects, dotfiles and CLI logins
Good for
- Running Claude Code, Codex, Gemini CLI or OpenCode on long tasks inside tmux
- A remote workspace for VS Code Remote-SSH, Cursor, Zed or plain SSH
- A consistent Linux environment for builds and experiments
- Access from a locked-down machine through the browser terminal
Cost
Measured on Railway with nobody running an agent: about 126 MiB of memory for the whole container (Caddy about 48 MiB, ttyd about 18 MiB, sshd about 7 MiB). Agent sessions, builds and parallel work add to that.
Services in this template
- Dev Box · from
baranberkay96/ubuntu-devbox-railway
Questions people ask
How do I connect?
Open the public URL and sign in to the web terminal as dev with WEB_PASSWORD, or connect with ssh -p {RAILWAY_TCP_PROXY_PORT} dev@{RAILWAY_TCP_PROXY_DOMAIN} using SSH_PASSWORD. Both passwords are on the Variables tab, and the deploy logs print the exact command. Adding your public key to SSH_AUTHORIZED_KEYS and clearing SSH_PASSWORD gives key-only access.
How do I sign in to the AI tools?
Bring your own accounts or keys. For Claude Code run claude and follow the login URL, or set ANTHROPIC_API_KEY. For Codex run codex login --device-auth or set OPENAI_API_KEY. Gemini CLI needs GEMINI_API_KEY, and OpenCode uses opencode auth login or OPENROUTER_API_KEY.
What persists across redeploys?
Everything under /home/dev, including projects, logins and per-user installs. Packages installed with sudo apt reset on redeploy unless listed in APT_PACKAGES. tmux sessions survive disconnects but not restarts.
Is there a password length requirement?
Yes. An SSH_PASSWORD under 12 characters turns SSH password login off, and a WEB_PASSWORD that is empty or under 12 characters locks the web login. The deploy logs say what to fix.
What are the usage rules?
Railway's Fair Use Policy applies to everything that runs on the box. AI usage is billed by the respective vendor.
Full template README
Deploy and Host Ubuntu 26.04 SSH + Claude Code + Codex with Railway
Quick start (nothing to fill in):
- Click Deploy and wait for the first build (about 3-5 minutes). Both passwords are generated for you.
- Open the service's public URL and click Open the web terminal (user
dev, passwordWEB_PASSWORDfrom the Variables tab). Or use SSH:ssh -p {RAILWAY_TCP_PROXY_PORT} dev@{RAILWAY_TCP_PROXY_DOMAIN}withSSH_PASSWORD. - Run
claudeand sign in with your Claude account (or setANTHROPIC_API_KEY), and/or runcodex login --device-authto use Codex with ChatGPT (or setOPENAI_API_KEY).
An always-on Ubuntu 26.04 LTS machine with SSH and a browser terminal. Claude Code, OpenAI Codex CLI, Gemini CLI and OpenCode are preinstalled next to tmux, Node.js, Python, uv and build tools. Your home directory, projects and CLI logins live on a persistent volume.
About Hosting Ubuntu 26.04 SSH + Claude Code + Codex
A remote dev box earns its keep when it stays online: agents keep working in tmux after you close your laptop, and you can connect from any computer, tablet or editor. Running one yourself means maintaining a Linux host, SSH access, tooling and storage that survives rebuilds. This community template builds a pinned Ubuntu 26.04 image and runs OpenSSH behind a Railway TCP proxy for the user dev (passwordless sudo, no root login). Passwords are generated at deploy, and SSH host keys stay on the volume, so clients never see "host key changed" after a redeploy. A password-protected status page and browser terminal run on the public URL. You bring your own AI subscriptions or API keys.
Common Use Cases
- Run Claude Code, Codex, Gemini CLI or OpenCode on long tasks inside tmux and check in from anywhere
- A remote workspace for VS Code Remote-SSH, Cursor, Zed or plain terminal SSH, from any device
- A consistent Linux environment for builds, scripts and experiments, without touching your laptop
- Quick access from a locked-down machine through the browser terminal
Dependencies for Ubuntu 26.04 SSH + Claude Code + Codex Hosting
- A Railway volume mounted at
/home(included) - A Railway TCP proxy for SSH on port 22 (included)
- Optional: accounts or API keys for the AI tools you use (Claude Pro/Max/Team or an Anthropic API key, ChatGPT or an OpenAI API key, a Gemini API key, any OpenCode provider)
- Optional: a GitHub token for private repositories
Deployment Dependencies
- Ubuntu container image: https://hub.docker.com/_/ubuntu
- Claude Code setup and login: https://code.claude.com/docs/en/setup
- OpenAI Codex CLI sign-in: https://learn.chatgpt.com/docs/auth
- Gemini CLI authentication: https://geminicli.com/docs/get-started/authentication/
- OpenCode CLI: https://opencode.ai/docs/cli/
- Railway TCP proxy: https://docs.railway.com/networking/tcp-proxy
- Railway Fair Use Policy: https://railway.com/legal/fair-use
Implementation Details
| Service | Source | Purpose |
|---|---|---|
| Dev Box | Dockerfile on ubuntu:resolute-20261105.1 (Ubuntu 26.04 LTS, digest-pinned) |
sshd on port 22 behind the TCP proxy; Caddy on PORT 8080 with a public /healthz, a status page and the ttyd web terminal behind basic auth; volume at /home |
Connect over SSH
- Open the service's Variables tab and copy
SSH_PASSWORD. The TCP proxy address is inRAILWAY_TCP_PROXY_DOMAINandRAILWAY_TCP_PROXY_PORT(also under Settings → Networking). - Connect:
ssh -p {RAILWAY_TCP_PROXY_PORT} dev@{RAILWAY_TCP_PROXY_DOMAIN}, for examplessh -p 11105 dev@roundhouse.proxy.rlwy.net. The deploy logs print the exact command and the host key fingerprints. - Recommended: paste your public key into
SSH_AUTHORIZED_KEYS, redeploy, then clearSSH_PASSWORDfor key-only access. Keys you add to~/.ssh/authorized_keysalso persist. - Start a persistent session so agents keep running when you disconnect:
tmux new -A -s main.
Status page and web terminal: open the public URL and log in as dev with WEB_PASSWORD. The page links the browser terminal (/terminal/, attached to the tmux session web) and shows the SSH command, an ~/.ssh/config snippet and the host key fingerprints. Set WEB_TERMINAL=false to turn the terminal off. Only /healthz is reachable without a password.
No value can break the deploy: an invalid port falls back to the default, and an unusable password fails closed instead of stopping the box. An SSH_PASSWORD under 12 characters turns SSH password login off. A WEB_PASSWORD that is empty, under 12 characters or over 72 bytes locks the web login with a random password. The deploy logs say what to fix.
Log in to the AI CLIs with your own accounts. Each CLI talks to its own vendor unless you configure a different provider:
- Claude Code: run
claude, open the login URL on your computer, then paste the code back into the terminal. Or setANTHROPIC_API_KEY, or aCLAUDE_CODE_OAUTH_TOKENcreated withclaude setup-token. - Codex CLI:
codex login --device-auth(enable device code login in your ChatGPT security settings first), or setOPENAI_API_KEY. - Gemini CLI: set
GEMINI_API_KEYfrom Google AI Studio. Google sign-in needs an eligible account; tryNO_BROWSER=true gemini. - OpenCode:
opencode auth login, or setOPENROUTER_API_KEY.
What persists: everything under /home/dev: projects in ~/workspace, CLI logins, dotfiles, and per-user installs (npm i -g goes to ~/.npm-global, plus pipx, uv tool and ~/.local/bin). Packages installed with sudo apt reset on redeploy; list them in APT_PACKAGES or ~/.config/devbox/apt-packages and they are reinstalled at every start. tmux sessions survive disconnects, not restarts.
Upgrading from the Ubuntu 24.04 version: redeploy the service. Files, logins, passwords and SSH host keys stay. Python moves from 3.12 to 3.14 and Node.js from 24 to 26, so the first start writes ~/.config/devbox/upgrade-notice.txt with the reinstall commands for pipx apps, uv tools, project virtualenvs and native npm packages.
Resources: idle (nobody connected) the box uses about 130 MB of RAM, so it boots on every plan, including Trial (1 GB per service). One agent session fits in 1 GB; builds and parallel agents need more, so Hobby or Pro is the plan for real work.
Scaling: this is a single-user machine, so keep one replica. Raise CPU and RAM in the service settings when builds or parallel agents need more. For a team, deploy one box per person.
Pinning and upgrades: Ubuntu, Node.js, Claude Code, Codex, Gemini CLI, OpenCode, uv, gh, ttyd and Caddy versions are build arguments at the top of the Dockerfile; change them and redeploy. For a newer CLI right away, run npm i -g @openai/codex@latest (or the Gemini CLI or OpenCode package) as dev, or claude install for a self-updating Claude Code in ~/.local/bin. These live on the volume and take precedence over the image.
Fair use: this box is for your own development work. Do not use it for cryptocurrency mining, proxies, VPNs or anonymizers, torrenting, or sharing shell access with others; Railway's Fair Use Policy applies and violations can get the account suspended. Docker-in-Docker and UDP (for example mosh) are not available on Railway.
Why Deploy Ubuntu 26.04 SSH + Claude Code + Codex on Railway?
Railway gives the box a TCP proxy for SSH, an HTTPS URL for the browser terminal and a persistent volume, with no server to administer. It keeps your agents running while you are away, and you pay for the CPU and memory the box actually uses.
Guides for this template
View Ubuntu 26.04 SSH + Claude Code + Codex on railway.com
Similar templates
| Template | Category | DeploymentsDeploys |
|---|---|---|
| Chatwoot A customer communication platform | Other | 5,871 |
| Ubuntu-Linux Ubuntu terminal accessible via web browser | Other | 4,926 |
| Ubuntu SSH + Claude ARA TM —SSH server with root access + Claude Code pre-installed. | Other | 4,682 |
| Debian-Linux Debian terminal accessible via web browser. | Other | 2,883 |
| Code Server VS Code in the browser | Other | 2,787 |
| Kali Linux (Web Terminal) Instant Kali Linux browser terminal powered by ttyd | Other | 2,632 |