diff --git a/RAILWAY_TEMPLATE_GUIDE.md b/RAILWAY_TEMPLATE_GUIDE.md index f4308da9d..a1de02beb 100644 --- a/RAILWAY_TEMPLATE_GUIDE.md +++ b/RAILWAY_TEMPLATE_GUIDE.md @@ -29,7 +29,7 @@ Step-by-step guide to configure the Claude Code Server Railway template. | Variable | Type | Description | |----------|------|-------------| | `PASSWORD` | **Secret** | Login password for code-server | -| `CLAUDER_HOME` | **Path** | Volume mount path — use `/home/coder` for existing deployments | +| `CLAUDER_HOME` | **Path** | Volume mount path (default: `/home/clauder`) | > ⚠️ **CRITICAL**: `CLAUDER_HOME` MUST match your volume mount path! @@ -40,25 +40,6 @@ Step-by-step guide to configure the Claude Code Server Railway template. | `CLAUDER_UID` | `1000` | User ID | | `CLAUDER_GID` | `1000` | Group ID | | `RUN_AS_USER` | `clauder` | Set to `root` if you need root access | - -### Pre-Install AI CLIs (default: 0) - -| Variable | Description | -|----------|-------------| -| `INSTALL_OPENCODE` | Install OpenCode | -| `INSTALL_GEMINI` | Install Gemini CLI | -| `INSTALL_KILOCODE` | Install KiloCode CLI | -| `INSTALL_CONTINUE` | Install Continue CLI | -| `INSTALL_CODEX` | Install Codex CLI | - -### Pre-Install Dev Frameworks (default: 0) - -| Variable | Description | -|----------|-------------| -| `INSTALL_BMAD` | Install BMAD Method | -| `INSTALL_OPENSPEC` | Install OpenSpec | -| `INSTALL_SPECKIT` | Install Spec-Kit | - --- ## Step 3: Volume Configuration (REQUIRED) @@ -128,7 +109,7 @@ These are pre-configured in `railway.toml`: > - ⚡ **Instant Setup** – Deploy in 60 seconds > - 💾 **Persistent** – Extensions & auth survive redeploys > - 🛡️ **Non-root** – Runs as `clauder` user for security -> - 🧠 **AI-Ready** – Optional: Gemini, OpenCode, Continue, Codex +> - 🧠 **Claude Code** – AI coding assistant built-in > > Perfect for vibe coding, weekend hacks, and shipping fast. @@ -138,8 +119,7 @@ These are pre-configured in `railway.toml`: | Old (code-server) | New (Claude Code Server) | |-------------------|--------------------------| -| Generic VS Code | Claude Code + AI CLIs | +| Generic VS Code | VS Code + Claude Code | | `coder` user | `clauder` user | -| No AI tools | 5 optional AI CLIs | -| No frameworks | BMAD, OpenSpec, Spec-Kit | +| No AI tools | Claude Code pre-installed | | Basic docs | Auth + region guidance | diff --git a/README.md b/README.md index dc72ba0b8..99045df5b 100644 --- a/README.md +++ b/README.md @@ -1,106 +1,82 @@ -# VSCode Cloud IDE +# Deploy and Host Claude Code Server on Railway -**Browser-based VSCode with Claude Code & Node.js** +

+ Claude Code Server Logo +

-[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/pHwM6f?referralCode=1uw5HI&utm_medium=integration&utm_source=template&utm_campaign=generic) +

+ Browser-based VS Code with Claude Code pre-installed. YOLO mode ready. +

-Cloud IDE with persistent extensions, settings, and tools. Runs as non-root user. +

+ + Deploy on Railway + +

--- -## Features +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. -- **Claude Code** & **Node.js 20** pre-installed -- **Non-root execution** - runs as `clauder` user (UID 1000) -- Extensions persist across redeployments -- Volume permissions auto-fixed on startup +## About Hosting Claude Code Server ---- +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. -## Quick Start +## Common Use Cases + +- **Remote AI-assisted development** – Code with Claude from any device with a browser +- **Ephemeral dev environments** – Spin up isolated workspaces for experiments or client projects +- **Team onboarding** – Pre-configured environments for new developers with tools ready to go +- **CI/CD integration** – Use as a hosted development server for automated workflows + +## Dependencies for Claude Code Server Hosting + +- **Railway account** – Free tier available +- **Anthropic API access** – For Claude Code authentication + +### Deployment Dependencies + +- [code-server](https://github.com/coder/code-server) – VS Code in the browser by Coder +- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) – AI coding assistant by Anthropic +- [Node.js 20 LTS](https://nodejs.org/) – JavaScript runtime + +### Implementation Details ```bash -# Claude Code with auto-accept (for automation) +# YOLO mode - skip permission prompts claude --dangerously-skip-permissions +# Or use the alias +claude-auto + # Interactive mode claude - -# Node.js ready -node --version -npm --version ``` ---- - ## Environment Variables | Variable | Required | Default | Description | |----------|----------|---------|-------------| -| `PASSWORD` | Yes | - | Login password | -| `CLAUDER_HOME` | **Yes** | `/home/clauder` | Volume mount path (REQUIRED) | +| `PASSWORD` | Yes | - | Login password for code-server | +| `CLAUDER_HOME` | Yes | `/home/clauder` | Volume mount path | | `CLAUDER_UID` | No | `1000` | User ID | | `CLAUDER_GID` | No | `1000` | Group ID | -| `RUN_AS_USER` | No | `clauder` | Set to `root` for root access | +| `RUN_AS_USER` | No | `clauder` | Set to `root` if needed | ---- +## Volume Configuration -## How It Works +> ⚠️ **CRITICAL**: Without a volume, ALL data is lost on every redeploy! -1. **Starts as root** - fixes volume permissions -2. **Switches to clauder** - uses `gosu` for clean handoff -3. **Runs code-server** - as non-root user +| Setting | Value | +|---------|-------| +| **Mount Path** | `/home/clauder` | +| **Size** | 5GB+ recommended | -This means: -- ✅ No root permission warnings in code-server -- ✅ Existing volumes with root-owned files work fine -- ✅ Claude `--dangerously-skip-permissions` works +## Why Deploy Claude Code Server 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. -## Claude Code Authentication - -After running `claude` for the first time: - -1. Follow the authentication prompts -2. Your credentials are stored in `~/.claude/` -3. They persist across redeployments (on volume) - ---- - -## Custom Startup Scripts - -Add to `$CLAUDER_HOME/entrypoint.d/`: - -```bash -#!/bin/bash -git config --global user.name "Your Name" -``` - -Make executable: `chmod +x script.sh` - ---- - -## Update Behavior - -| Component | Behavior | -|-----------|----------| -| **Volume tools** | You control - install to `~/.local/node/` or `~/.claude/local/` | -| **Image tools** | Auto-update on redeploy (fallback) | -| **Extensions** | Persist on volume | -| **Claude auth** | Persists on volume | - -Logs show `[volume]` or `[image]` next to each tool. - ---- - -## Troubleshooting - -| Issue | Solution | -|-------|----------| -| Permission denied | Check `CLAUDER_UID` matches your volume owner | -| Claude not found | Run `which claude` to check PATH | -| Extensions missing | Verify volume mounted at `CLAUDER_HOME` | +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. --- diff --git a/public/claude-code-server-logo.png b/public/claude-code-server-logo.png new file mode 100644 index 000000000..9b7d5ee33 Binary files /dev/null and b/public/claude-code-server-logo.png differ diff --git a/public/social-preview.png b/public/social-preview.png new file mode 100644 index 000000000..9d4af5aaf Binary files /dev/null and b/public/social-preview.png differ diff --git a/railway-entrypoint.sh b/railway-entrypoint.sh index 5e3ae3be7..79f5f6061 100644 --- a/railway-entrypoint.sh +++ b/railway-entrypoint.sh @@ -170,8 +170,8 @@ You'll need to authenticate with your Anthropic API key on first use. Set these environment variables in Railway: -- `RUN_AS_USER=coder` - Run as non-root user (recommended for Claude) -- `RUN_AS_USER=root` - Stay as root (default) +- `RUN_AS_USER=clauder` - Run as non-root user (recommended for Claude) +- `RUN_AS_USER=root` - Stay as root Happy coding! 🚀 WELCOME @@ -239,10 +239,18 @@ fi # START CODE-SERVER # ============================================================================ +# Branding customization +APP_NAME="${APP_NAME:-Claude Code Server}" +WELCOME_TEXT="${WELCOME_TEXT:-Welcome to Claude Code Server}" + echo "" echo "════════════════════════════════════════════════════════════════════════" -echo "Starting code-server as $(whoami)..." +echo "Starting $APP_NAME as $(whoami)..." echo "════════════════════════════════════════════════════════════════════════" echo "" -exec dumb-init /usr/bin/code-server --bind-addr 0.0.0.0:8080 /home/coder/workspace +exec dumb-init /usr/bin/code-server \ + --bind-addr 0.0.0.0:8080 \ + --app-name "$APP_NAME" \ + --welcome-text "$WELCOME_TEXT" \ + "$CLAUDER_HOME/workspace"