Deploy code-server
VS Code in the browser: password login, Node, Python, sudo, persistent home
code-server
Just deployed
Deploy and Host code-server on Railway
code-server runs VS Code in your browser: the editor, extensions, the integrated terminal and Git, on a server you can reach from any device. This template runs it on Railway behind a password, with Node.js, Python and build tools ready in the terminal, and a volume that keeps your projects, settings and extensions across redeploys.
This is a community template, not made or supported by Coder or Microsoft.
About Hosting code-server
code-server needs a long-running server with storage that survives restarts, a password in front of it, and a public HTTPS address that passes WebSockets. Railway gives it all three. This template:
- opens on a password generated at deploy time (the
PASSWORDvariable) - keeps
/home/coderon a volume: your projects in~/workspace, extensions, settings, shell history and anything you install withnpm -g --prefix ~/.localorpip install --user - prepares the volume for the
coderuser, so the editor and terminal never hit permission errors - adds Node.js LTS with npm and npx, Python 3 with pip and venv, gcc and make, ripgrep, jq, tmux and zip to the official image
Open it: visit the service's domain and enter the PASSWORD from the service's Variables tab.
Common Use Cases
- A full VS Code from a tablet, a Chromebook or a borrowed computer
- A dev box next to your Railway databases, reaching them over the private network
- Editing and testing a project when your own machine is too slow or not with you
Dependencies for code-server Hosting
- A Railway account. The editor itself needs no outside services.
Deployment Dependencies
Implementation Details
- Tested on Railway: the password login (a wrong password is refused, and the editor's WebSocket gets 401 without a session and 101 with one); Node.js 26 with npm and npx, Python 3.13 with pip and venv, gcc 14 and sudo in the terminal; installing extensions from Open VSX; a redeploy kept the extensions and projects; an
npm installof TypeScript, ESLint, Vite and React plus a TypeScript compile at 0.5 GB of memory, with no out-of-memory kills. - Extensions come from Open VSX, the open marketplace code-server uses. Most popular extensions are there; a few Microsoft-only ones (Remote, Live Share, the C# Dev Kit) are not.
- What persists: everything under
/home/coder. Packages installed withsudo apt-get installare gone after a redeploy, since they live outside the volume. Put setup commands in an executable script in~/entrypoint.dto rerun them on every start. - Security: the password protects a terminal with sudo. Keep it strong, and change it by editing
PASSWORD(the service redeploys). - Memory: about 200 MB idle. It runs on the Free plan's 0.5 GB for editing and light builds; language servers for big projects and heavy builds want 1 to 2 GB. Railway counts the kernel's file cache as memory, so the template drops the cache of your home folder every 15 minutes.
- Updates: a new code-server version comes with an update of this template; the in-app update check is off.
- Image:
ghcr.io/two-workspaces/code-server, built from this repository's Dockerfile oncodercom/code-server:4.145.2.
Why Deploy 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.
By deploying 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.
Template Content
code-server
ghcr.io/two-workspaces/code-server:5a906b8