Deploy Debian SSH + Claude Code, Codex, Gemini
Debian 13 SSH server with Claude Code, Codex, Gemini CLI, OpenCode
AI Coding Box
Just deployed
/data
Deploy and Host Debian SSH + Claude Code, Codex, Gemini on Railway
An always-on Debian 13 box for AI coding agents. Claude Code, OpenAI Codex CLI, Gemini CLI and OpenCode are preinstalled. Connect over SSH from your own terminal or VS Code, or open the browser terminal from any device, and let agents keep working in tmux after you close your laptop. Your home folder, repos and agent logins live on a volume.
About Hosting Debian SSH + Claude Code, Codex, Gemini
The template builds debian-13-ai/Dockerfile from the open source repo github.com/nerminsabanovic31/railway-web-terminals on top of the official debian:trixie image. ttyd serves a full shell over Railway's HTTPS domain, protected by HTTP basic auth with USERNAME and a generated PASSWORD that you copy from the service Variables. The shell runs inside tmux, so closing the tab never kills your work, and the home folder lives on a volume at /data, so files survive restarts and redeploys. The template also runs OpenSSH on port 22 behind a Railway TCP proxy, so you can connect with any SSH client, VS Code Remote SSH, scp or rsync using the same login. Root login is disabled, and the SSH host keys are kept on the volume so your client never sees a changed key after a redeploy.
Common Use Cases
- Running Claude Code, Codex, Gemini or OpenCode on long tasks in tmux while your own computer is off
- A separate sandbox for coding agents, away from your personal machine and files
- Coding with an agent from a phone, tablet or Chromebook through the browser terminal
Dependencies for Debian SSH + Claude Code, Codex, Gemini Hosting
- No other services: one container plus a volume
- Any modern browser; works on phones and tablets too
Implementation Details
Open the Railway domain, sign in with USERNAME and PASSWORD, and you are in a bash shell as a user with passwordless sudo. Preinstalled: Claude Code, OpenAI Codex CLI, Gemini CLI, OpenCode, Node.js 24 with npm, GitHub CLI (gh), ripgrep, jq, fd, git, curl, vim, tmux, Python 3 with pip and a C compiler. Install anything else with:
sudo apt update && sudo apt install -y
Close the tab at any time; reopen the domain to land back in the same tmux session. 1 GB of memory is a good start for coding agents.
SSH: open the service, go to Settings, Networking and copy the TCP proxy host and port, then run:
ssh -p admin@
Use PASSWORD, or paste your public keys into AUTHORIZED_KEYS and set SSH_PASSWORD_LOGIN to no for key-only login. Run tmux attach -t main to join the same session as the browser.
Coding agents: run claude, codex, gemini or opencode and sign in with your own Anthropic, OpenAI, Google or other provider account, or paste API keys into the optional ANTHROPIC_API_KEY, OPENAI_API_KEY and GEMINI_API_KEY variables; they are exported into every browser, SSH and tmux shell. Credentials stay in your home folder on the volume. Update the agents any time with sudo npm update -g.
Keep an agent running: start it in its own tmux session, for example tmux new -s agent claude, then close the tab or SSH connection. Reattach later with tmux attach -t agent.
Your code: set GIT_REPO to clone a repository into ~/workspace on first start, and GH_TOKEN for private repos, gh and git push.
Why Deploy Debian SSH + Claude Code, Codex, Gemini 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 Debian SSH + Claude Code, Codex, Gemini 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
AI Coding Box
nerminsabanovic31/railway-web-terminals