Deploy code-server
VS Code in the browser with Claude Code and Codex, a password and a volume
code-server
Just deployed
Deploy and Host code-server on Railway
code-server runs VS Code in your browser: the same editor, extensions and terminal, on a server you can open from any device. This template runs code-server 4.141.0 with Node.js 22 and the Claude Code and Codex CLIs ready in its terminal.
About Hosting code-server
The editor and its terminal give full control of the container, so the login is set before anything else: PASSWORD is generated at deploy, and the start step won't run code-server without it.
The whole home directory (/home/coder) is a volume, so extensions, settings, terminal history, CLI logins and your projects survive redeploys. The official image runs as the coder user while Railway mounts volumes as root; the start step hands the volume to coder before starting the editor, which is what keeps it writable.
Claude Code and Codex are installed in the image. Run claude or codex in the terminal and sign in with your Claude or ChatGPT account, or set ANTHROPIC_API_KEY / OPENAI_API_KEY on the service.
Before publishing I tested it on Railway. /healthz answered, the editor sent visitors to the login page, PASSWORD signed in and the workbench loaded. The start log showed Node.js 22.23.3, Claude Code 2.1.295 and Codex 0.162.0, and a new home directory on the volume. After a restart the log found the same home directory, with the date it was created, and sign-in worked again.
Idle, it used 0.06 to 0.10 GB of RAM, under $1 a month on Railway's usage pricing. Builds and agents use more while they run.
Common Use Cases
- A full VS Code you can open from a laptop, tablet or a borrowed computer
- Running Claude Code or Codex on a server that keeps working after you close the tab
- A shared editing environment next to your other Railway services, on the private network
Dependencies for code-server Hosting
Nothing beyond the template. For the coding agents, a Claude or ChatGPT account, or an API key.
Deployment Dependencies
- code-server: https://github.com/coder/code-server
- Image:
codercom/code-server:4.141.0 - The wrapper this template builds: https://github.com/dektionstudio/railway-template-images/tree/main/code-server
Implementation Details
CODE_SERVER_URL # open this and sign in with PASSWORD
/home/coder # the volume: settings, extensions, logins, projects (/home/coder/project opens first)
Packages installed with sudo apt install go away on the next redeploy, because only the home directory persists. This is a container, not a VM: there is no Docker or systemd inside.
Why Deploy code-server on Railway?
You get your editor on HTTPS behind a password, with your files kept on a volume and nothing to install on the devices you use. Railway bills the RAM it uses, which is little while it sits idle.
Template Content
code-server
dektionstudio/railway-template-images