
Deploy code-server Claude Code
Run Claude Code in a browser VS Code you host
code-server
Just deployed
/home/coder
Deploy and Host self hosted code-server Claude Code (Open-Source Cloud IDE) on Railway
Claude Code inside a browser VS Code you control. code-server 4.141.0 runs on Railway with a persistent home on a volume, so the installer, your login and history survive redeploys. Open the domain, paste the password, and the agent sits beside your code.
About Hosting code-server Claude Code open-source software on Railway (self hosted code-server with Claude Code template)
code-server is Coder's MIT-licensed VS Code server. It serves the editor, terminal, git, debugging and extensions to any browser. This template pins codercom/code-server:4.141.0 by tag and digest, exposes port 8080, health-checks /healthz and mounts a volume at /home/coder.
Claude Code installs with the native installer, curl -fsSL https://claude.ai/install.sh | bash. That puts a launcher at ~/.local/bin/claude and versions under ~/.local/share/claude/versions, no Node.js involved.
The container starts as root only long enough to chown the volume to uid 1000 and seed shell files, then drops privileges. The editor and terminals never run as root, and that chown runs on first boot only.
Why Deploy code-server Claude Code, the GitHub Codespaces alternative on Railway (Railway Free Trial)
Codespaces bills per core-hour and builds a managed box from a devcontainer. This is one always-on environment with a flat cost you can see, a $5 Railway trial, and a home you own. For one developer running an agent, that's simpler.
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 code-server Claude Code 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.
Railway vs Other Hosting Providers and VPS for code-server Claude Code self hosting
Most alternatives are a VPS where you install Docker, put a WebSocket-capable proxy in front, and remember to patch it.
| Provider | What you get | Trade-offs |
|---|---|---|
| DigitalOcean | A droplet with Docker, snapshots and a simple firewall | You run TLS, the proxy and updates |
| AWS | EC2 plus EBS, fine-grained networking and IAM | Most knobs and most setup, easy to misconfigure |
| Hetzner | Cheap monthly VPS with good CPU for the money | Fewer managed extras and limited regions |
Common Use Cases for hosted code-server Claude Code
- Coding from a tablet or Chromebook: the full editor, terminal and Claude Code in Safari, no local toolchain.
- Long agent runs that outlive a laptop lid: start Claude Code in tmux and close the browser.
- One persistent environment for side projects: the volume keeps repos, settings and your Claude login.
- Reviewing Claude Code diffs in the editor: source control, file tree and terminal in one tab.
- Keeping agent work off a work laptop: the agent and its credentials stay on Railway.
Dependencies for code-server Claude Code Docker hosted on Railway
You need a Railway account and a Claude account with Claude Code, or an ANTHROPIC_API_KEY. The template ships one service, all defaulted, so your only input is the generated PASSWORD. That password is the only gate to a shell holding Claude credentials and repo tokens, so keep it long. No database, no build step.
Deployment Dependencies for Managed code-server Claude Code Service (Cloud IDE)
The service runs codercom/code-server:4.141.0 on port 8080 with health check /healthz, unauthenticated, 120 second timeout, restart policy ALWAYS. The volume mounts at /home/coder.
Implementation Details for code-server Claude Code (Using code-server official docker image)
Root chowns the volume to uid 1000, seeds .bashrc and .profile from /etc/skel, then drops to coder and runs the upstream entrypoint with --bind-addr 0.0.0.0:8080 --disable-telemetry --enable-remote-storage. Scripts in ~/.entrypoint.d run as coder every boot, which is where apt packages such as tmux belong, since apt installs outside /home/coder vanish on redeploy.
How does code-server Claude Code compare against other cloud coding environments
code-server vs GitHub Codespaces
- Billing: per core-hour there, a flat $5-15 a month here for light use.
- Persistence: a volume across redeploys here; a Codespace follows its repo.
- Claude Code: you install it in the terminal and pick the version.
code-server vs Claude Code on the web
- Where code runs: Anthropic's sandbox there, your Railway volume here.
- Editor: full VS Code with extensions here, chat and diffs there.
- Network: your keys and proxy ports here, a tighter sandbox there.
code-server vs Gitpod
- Lifecycle: Gitpod builds ephemeral workspaces; this one stays put.
- Setup: no .gitpod.yml, just install Claude Code once in home.
- Cost: usage-based there, flat infrastructure here.
code-server vs Coder
- Scope: Coder provisions many team workspaces; this is one dev box.
- Ops: Coder wants a control plane; Railway runs the container.
- License: code-server is MIT; the Coder platform is open core plus paid tiers.
How to use code-server Claude Code (the OSS browser VS Code)?
- Open the Railway domain and paste PASSWORD from the Variables tab. You land in /home/coder/workspace.
- Open a terminal from the Terminal menu.
- Run the native installer:
curl -fsSL https://claude.ai/install.sh | bash
- Open a new terminal so PATH updates, then check it:
claude --version
claude doctor
- Run claude. It prints a URL you open on your own device to finish login, or export ANTHROPIC_API_KEY and approve it.
- Move into a project:
cd /home/coder/workspace/myproject
- Start long work in tmux so a closed tab does not kill it:
tmux new -s agent
claude
tmux isn't in the image. Install it from an executable script in ~/.entrypoint.d so it returns after every redeploy: sudo apt-get update, then sudo apt-get install -y tmux. Detach with Ctrl-b then d, and reattach with tmux attach -t agent from any device.
How to self host code-server Claude Code on other VPS Services (code-server self hosting guide)
Outside Railway you need a Linux host, a volume for /home/coder and a reverse proxy that passes WebSockets, since the editor and terminal use them.
Clone the Repository
Clone coder/code-server if you want to build or read the source. The Docker route skips this.
Install Dependencies
Docker, or the install script: curl -fsSL https://code-server.dev/install.sh | sh. Claude Code wants Ubuntu 20.04+ or Debian 10+ and 4 GB of RAM.
Configure Environment Variables
With the image, set PASSWORD or a HASHED_PASSWORD argon2 hash. With a manual install, write ~/.config/code-server/config.yaml with bind-addr, auth: password and password. Put HTTPS in front with Caddy or nginx.
Start the code-server Claude Code Application
Run the container with a volume on /home/coder, publish 8080, restart always, then log in and install Claude Code in the terminal. Put TLS in front first.
Official Pricing of code-server Claude Code (code-server pricing)
code-server is free and open source under MIT; Coder the company sells a separate enterprise platform, and this overview quotes no prices for it. One always-on code-server at light to moderate use runs about $5-15 a month on Railway depending on RAM, on top of the $5 trial credit. A Claude plan is separate, and API key usage is billed by Anthropic.
code-server Claude Code cloud vs self hosted comparison (Pricing, features, costs, and more)
The template is a managed container with the boring parts done. A VPS is the same software with more knobs and more evenings. The trade is control against maintenance.
| Railway template | VPS you run | |
|---|---|---|
| Setup | One deploy, password generated | Install, proxy, TLS, firewall |
| TLS and domain | Railway domain, custom domain in settings | Caddy or nginx and certificates |
| Persistence | Volume on /home/coder | Your disk or block storage |
| Upgrades | Change image tag, home stays | Rebuild or patch yourself |
Monthly cost of self hosting code-server Claude Code on Railway
Budget about $5-15 a month for one always-on service, near the top at 4 GB RAM. Idle boxes are cheap; long builds and agents move the number.
System Requirements for Hosting code-server Claude Code on a VPS
Ubuntu 20.04+ or Debian 10+, 4 GB+ RAM for Claude Code, x64 or ARM64, and disk for repos and caches. A WebSocket-capable proxy is required. Two vCPUs make builds tolerable.
Frequently Asked Questions (FAQs)
Does Claude Code survive a redeploy?
Yes, if it lives under /home/coder. The launcher, login, history and settings persist on the volume. apt packages do not, so script them in ~/.entrypoint.d.
Do I need Node.js?
No. The native installer ships a binary. The npm package also installs that binary and wants Node 22 or newer, but you can skip npm.
Which accounts work?
Claude Pro, Max, Team, Enterprise or Console. The free claude.ai plan does not include Claude Code. ANTHROPIC_API_KEY works instead, and Claude Code asks you to approve it.
How do I keep a session running when I close the tab?
Run Claude Code inside tmux. Install tmux from an entrypoint script, start tmux new -s agent, detach with Ctrl-b then d, and attach again from any device.
Can I install the Claude Code VS Code extension?
Check Open VSX, which code-server uses, and install from there. If it's missing, use the CLI in the terminal, or sideload a .vsix file.
How much RAM do I need?
4 GB or more for Claude Code, since the editor and language servers sit alongside it. The image alone is fine at 1-2 GB. Big projects want more.
Template Content
code-server
codercom/code-server:4.141.0