Skip to content

Commit c2d4bff

Browse files
committed
Fixed railway setup
1 parent 1266e7d commit c2d4bff

5 files changed

Lines changed: 66 additions & 102 deletions

File tree

β€ŽRAILWAY_TEMPLATE_GUIDE.mdβ€Ž

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Step-by-step guide to configure the Claude Code Server Railway template.
2929
| Variable | Type | Description |
3030
|----------|------|-------------|
3131
| `PASSWORD` | **Secret** | Login password for code-server |
32-
| `CLAUDER_HOME` | **Path** | Volume mount path β€” use `/home/coder` for existing deployments |
32+
| `CLAUDER_HOME` | **Path** | Volume mount path (default: `/home/clauder`) |
3333

3434
> ⚠️ **CRITICAL**: `CLAUDER_HOME` MUST match your volume mount path!
3535
@@ -40,25 +40,6 @@ Step-by-step guide to configure the Claude Code Server Railway template.
4040
| `CLAUDER_UID` | `1000` | User ID |
4141
| `CLAUDER_GID` | `1000` | Group ID |
4242
| `RUN_AS_USER` | `clauder` | Set to `root` if you need root access |
43-
44-
### Pre-Install AI CLIs (default: 0)
45-
46-
| Variable | Description |
47-
|----------|-------------|
48-
| `INSTALL_OPENCODE` | Install OpenCode |
49-
| `INSTALL_GEMINI` | Install Gemini CLI |
50-
| `INSTALL_KILOCODE` | Install KiloCode CLI |
51-
| `INSTALL_CONTINUE` | Install Continue CLI |
52-
| `INSTALL_CODEX` | Install Codex CLI |
53-
54-
### Pre-Install Dev Frameworks (default: 0)
55-
56-
| Variable | Description |
57-
|----------|-------------|
58-
| `INSTALL_BMAD` | Install BMAD Method |
59-
| `INSTALL_OPENSPEC` | Install OpenSpec |
60-
| `INSTALL_SPECKIT` | Install Spec-Kit |
61-
6243
---
6344

6445
## Step 3: Volume Configuration (REQUIRED)
@@ -128,7 +109,7 @@ These are pre-configured in `railway.toml`:
128109
> - ⚑ **Instant Setup** – Deploy in 60 seconds
129110
> - πŸ’Ύ **Persistent** – Extensions & auth survive redeploys
130111
> - πŸ›‘οΈ **Non-root** – Runs as `clauder` user for security
131-
> - 🧠 **AI-Ready** – Optional: Gemini, OpenCode, Continue, Codex
112+
> - 🧠 **Claude Code** – AI coding assistant built-in
132113
>
133114
> Perfect for vibe coding, weekend hacks, and shipping fast.
134115
@@ -138,8 +119,7 @@ These are pre-configured in `railway.toml`:
138119

139120
| Old (code-server) | New (Claude Code Server) |
140121
|-------------------|--------------------------|
141-
| Generic VS Code | Claude Code + AI CLIs |
122+
| Generic VS Code | VS Code + Claude Code |
142123
| `coder` user | `clauder` user |
143-
| No AI tools | 5 optional AI CLIs |
144-
| No frameworks | BMAD, OpenSpec, Spec-Kit |
124+
| No AI tools | Claude Code pre-installed |
145125
| Basic docs | Auth + region guidance |

β€ŽREADME.mdβ€Ž

Lines changed: 50 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,82 @@
1-
# VSCode Cloud IDE
1+
# Deploy and Host Claude Code Server on Railway
22

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>
46

5-
[![Deploy on Railway](https://railway.com/button.svg)](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>
610

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>
816

917
---
1018

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.
1220

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
1722

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
1933

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
2144

2245
```bash
23-
# Claude Code with auto-accept (for automation)
46+
# YOLO mode - skip permission prompts
2447
claude --dangerously-skip-permissions
2548

49+
# Or use the alias
50+
claude-auto
51+
2652
# Interactive mode
2753
claude
28-
29-
# Node.js ready
30-
node --version
31-
npm --version
3254
```
3355

34-
---
35-
3656
## Environment Variables
3757

3858
| Variable | Required | Default | Description |
3959
|----------|----------|---------|-------------|
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 |
4262
| `CLAUDER_UID` | No | `1000` | User ID |
4363
| `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 |
5865

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
7467

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!
8569
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 |
9274

93-
Logs show `[volume]` or `[image]` next to each tool.
94-
95-
---
75+
## Why Deploy Claude Code Server on Railway?
9676

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.
9878

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.
10480

10581
---
10682

240 KB
Loading

β€Žpublic/social-preview.pngβ€Ž

412 KB
Loading

β€Žrailway-entrypoint.shβ€Ž

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ You'll need to authenticate with your Anthropic API key on first use.
170170
171171
Set these environment variables in Railway:
172172
173-
- `RUN_AS_USER=coder` - Run as non-root user (recommended for Claude)
174-
- `RUN_AS_USER=root` - Stay as root (default)
173+
- `RUN_AS_USER=clauder` - Run as non-root user (recommended for Claude)
174+
- `RUN_AS_USER=root` - Stay as root
175175
176176
Happy coding! πŸš€
177177
WELCOME
@@ -239,10 +239,18 @@ fi
239239
# START CODE-SERVER
240240
# ============================================================================
241241

242+
# Branding customization
243+
APP_NAME="${APP_NAME:-Claude Code Server}"
244+
WELCOME_TEXT="${WELCOME_TEXT:-Welcome to Claude Code Server}"
245+
242246
echo ""
243247
echo "════════════════════════════════════════════════════════════════════════"
244-
echo "Starting code-server as $(whoami)..."
248+
echo "Starting $APP_NAME as $(whoami)..."
245249
echo "════════════════════════════════════════════════════════════════════════"
246250
echo ""
247251

248-
exec dumb-init /usr/bin/code-server --bind-addr 0.0.0.0:8080 /home/coder/workspace
252+
exec dumb-init /usr/bin/code-server \
253+
--bind-addr 0.0.0.0:8080 \
254+
--app-name "$APP_NAME" \
255+
--welcome-text "$WELCOME_TEXT" \
256+
"$CLAUDER_HOME/workspace"

0 commit comments

Comments
Β (0)