|
1 | | -# VSCode Cloud IDE |
| 1 | +# Deploy and Host Claude Code Server on Railway |
2 | 2 |
|
3 | | -**Browser-based VSCode with Claude Code & Node.js** |
| 3 | +<p align="center"> |
| 4 | + <img src="https://raw.githubusercontent.com/sphinxcode/claude-code-server/main/public/claude-code-server-logo.svg" alt="Claude Code Server Logo" width="120" height="120"> |
| 5 | +</p> |
4 | 6 |
|
5 | | -[](https://railway.com/deploy/pHwM6f?referralCode=1uw5HI&utm_medium=integration&utm_source=template&utm_campaign=generic) |
| 7 | +<p align="center"> |
| 8 | + <strong>Browser-based VS Code with Claude Code pre-installed. YOLO mode ready.</strong> |
| 9 | +</p> |
6 | 10 |
|
7 | | -Cloud IDE with persistent extensions, settings, and tools. Runs as non-root user. |
| 11 | +<p align="center"> |
| 12 | + <a href="https://railway.com/deploy/pHwM6f?referralCode=1uw5HI&utm_medium=integration&utm_source=template&utm_campaign=generic"> |
| 13 | + <img src="https://railway.com/button.svg" alt="Deploy on Railway"> |
| 14 | + </a> |
| 15 | +</p> |
8 | 16 |
|
9 | 17 | --- |
10 | 18 |
|
11 | | -## Features |
| 19 | +Claude Code Server is a cloud-based VS Code environment with Claude Code CLI pre-installed. Deploy in 60 seconds and start AI-assisted coding directly in your browser. Runs as non-root `clauder` user with persistent storage for extensions, authentication, and workspace files. |
12 | 20 |
|
13 | | -- **Claude Code** & **Node.js 20** pre-installed |
14 | | -- **Non-root execution** - runs as `clauder` user (UID 1000) |
15 | | -- Extensions persist across redeployments |
16 | | -- Volume permissions auto-fixed on startup |
| 21 | +## About Hosting Claude Code Server |
17 | 22 |
|
18 | | ---- |
| 23 | +Hosting Claude Code Server on Railway provides a fully configured development environment accessible from any browser. The template handles user permissions, volume persistence, and Claude Code installation automatically. On first deploy, set your `PASSWORD` environment variable and attach a volume to `/home/clauder`. The entrypoint script manages permission fixes, user switching via `gosu`, and shell configuration. Your Claude authentication tokens, VS Code extensions, and workspace files persist across redeploys via the mounted volume. |
| 24 | + |
| 25 | +## Common Use Cases |
| 26 | + |
| 27 | +- **Remote AI-assisted development** β Code with Claude from any device with a browser |
| 28 | +- **Ephemeral dev environments** β Spin up isolated workspaces for experiments or client projects |
| 29 | +- **Team onboarding** β Pre-configured environments for new developers with tools ready to go |
| 30 | +- **CI/CD integration** β Use as a hosted development server for automated workflows |
| 31 | + |
| 32 | +## Dependencies for Claude Code Server Hosting |
19 | 33 |
|
20 | | -## Quick Start |
| 34 | +- **Railway account** β Free tier available |
| 35 | +- **Anthropic API access** β For Claude Code authentication |
| 36 | + |
| 37 | +### Deployment Dependencies |
| 38 | + |
| 39 | +- [code-server](https://github.com/coder/code-server) β VS Code in the browser by Coder |
| 40 | +- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) β AI coding assistant by Anthropic |
| 41 | +- [Node.js 20 LTS](https://nodejs.org/) β JavaScript runtime |
| 42 | + |
| 43 | +### Implementation Details |
21 | 44 |
|
22 | 45 | ```bash |
23 | | -# Claude Code with auto-accept (for automation) |
| 46 | +# YOLO mode - skip permission prompts |
24 | 47 | claude --dangerously-skip-permissions |
25 | 48 |
|
| 49 | +# Or use the alias |
| 50 | +claude-auto |
| 51 | + |
26 | 52 | # Interactive mode |
27 | 53 | claude |
28 | | - |
29 | | -# Node.js ready |
30 | | -node --version |
31 | | -npm --version |
32 | 54 | ``` |
33 | 55 |
|
34 | | ---- |
35 | | - |
36 | 56 | ## Environment Variables |
37 | 57 |
|
38 | 58 | | Variable | Required | Default | Description | |
39 | 59 | |----------|----------|---------|-------------| |
40 | | -| `PASSWORD` | Yes | - | Login password | |
41 | | -| `CLAUDER_HOME` | **Yes** | `/home/clauder` | Volume mount path (REQUIRED) | |
| 60 | +| `PASSWORD` | Yes | - | Login password for code-server | |
| 61 | +| `CLAUDER_HOME` | Yes | `/home/clauder` | Volume mount path | |
42 | 62 | | `CLAUDER_UID` | No | `1000` | User ID | |
43 | 63 | | `CLAUDER_GID` | No | `1000` | Group ID | |
44 | | -| `RUN_AS_USER` | No | `clauder` | Set to `root` for root access | |
45 | | - |
46 | | ---- |
47 | | - |
48 | | -## How It Works |
49 | | - |
50 | | -1. **Starts as root** - fixes volume permissions |
51 | | -2. **Switches to clauder** - uses `gosu` for clean handoff |
52 | | -3. **Runs code-server** - as non-root user |
53 | | - |
54 | | -This means: |
55 | | -- β
No root permission warnings in code-server |
56 | | -- β
Existing volumes with root-owned files work fine |
57 | | -- β
Claude `--dangerously-skip-permissions` works |
| 64 | +| `RUN_AS_USER` | No | `clauder` | Set to `root` if needed | |
58 | 65 |
|
59 | | ---- |
60 | | - |
61 | | -## Claude Code Authentication |
62 | | - |
63 | | -After running `claude` for the first time: |
64 | | - |
65 | | -1. Follow the authentication prompts |
66 | | -2. Your credentials are stored in `~/.claude/` |
67 | | -3. They persist across redeployments (on volume) |
68 | | - |
69 | | ---- |
70 | | - |
71 | | -## Custom Startup Scripts |
72 | | - |
73 | | -Add to `$CLAUDER_HOME/entrypoint.d/`: |
| 66 | +## Volume Configuration |
74 | 67 |
|
75 | | -```bash |
76 | | -#!/bin/bash |
77 | | -git config --global user.name "Your Name" |
78 | | -``` |
79 | | - |
80 | | -Make executable: `chmod +x script.sh` |
81 | | - |
82 | | ---- |
83 | | - |
84 | | -## Update Behavior |
| 68 | +> β οΈ **CRITICAL**: Without a volume, ALL data is lost on every redeploy! |
85 | 69 |
|
86 | | -| Component | Behavior | |
87 | | -|-----------|----------| |
88 | | -| **Volume tools** | You control - install to `~/.local/node/` or `~/.claude/local/` | |
89 | | -| **Image tools** | Auto-update on redeploy (fallback) | |
90 | | -| **Extensions** | Persist on volume | |
91 | | -| **Claude auth** | Persists on volume | |
| 70 | +| Setting | Value | |
| 71 | +|---------|-------| |
| 72 | +| **Mount Path** | `/home/clauder` | |
| 73 | +| **Size** | 5GB+ recommended | |
92 | 74 |
|
93 | | -Logs show `[volume]` or `[image]` next to each tool. |
94 | | - |
95 | | ---- |
| 75 | +## Why Deploy Claude Code Server on Railway? |
96 | 76 |
|
97 | | -## Troubleshooting |
| 77 | +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. |
98 | 78 |
|
99 | | -| Issue | Solution | |
100 | | -|-------|----------| |
101 | | -| Permission denied | Check `CLAUDER_UID` matches your volume owner | |
102 | | -| Claude not found | Run `which claude` to check PATH | |
103 | | -| Extensions missing | Verify volume mounted at `CLAUDER_HOME` | |
| 79 | +By deploying Claude Code Server 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. |
104 | 80 |
|
105 | 81 | --- |
106 | 82 |
|
|
0 commit comments