Deploy Code Server | (Just Updated) VS Code in Browser, Files Survive Redeploys
Browser VS Code on a volume - files, settings, extensions survive redeploys
code-server
Just deployed
/home/coder
Deploy and Host code-server on Railway
code-server runs Visual Studio Code as a web application, so a full IDE — editor, integrated terminal, extension marketplace, source control — is reachable from any browser. This template deploys code-server 4.134.0 with its home directory on a persistent volume, because a stock deploy keeps your files, settings and extensions on the container's disposable layer and loses all of them on every redeploy.
About Hosting code-server
This template runs code-server as one service with a volume mounted at /home/coder, which is where the editor keeps everything durable: your project files, settings.json, keybindings, installed extensions, the SSH directory and the shell profile. Railway mounts volumes as root while code-server runs as an unprivileged user, so the container repairs ownership on the mount before the editor starts, and it restores the shell skeleton files the mount would otherwise hide. The server binds Railway's injected port rather than the port baked into the upstream image, and it is healthchecked on /healthz. The access password is generated per deployment and the container refuses to boot without one.
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.
- Your work survives a redeploy — the home directory is on a volume. Files,
settings.json, keybindings and installed extensions are all still there after a restart or a redeploy, which is not true of a deployment without one. - Current VS Code — code-server 4.134.0, pinned, on an image that is pulled rather than rebuilt on your build minutes.
- It will not start unprotected — the container exits with a clear error if no password is set, so a public URL is never served without authentication.
- Nothing blank to fill in — the deploy form generates the password for you; there are no required fields left empty.
Common Use Cases
- A development machine you can reach from anywhere — write and run code from a laptop, a tablet or a borrowed machine, with the environment and extensions you left behind.
- A workspace beside your other Railway services — edit and debug against databases and APIs already running in the same project over the private network.
- A disposable but persistent sandbox — clone a repository at first boot with
GIT_REPOand keep the working tree across restarts.
Dependencies for code-server Hosting
- A volume mounted at
/home/coder(included) for projects, settings and extensions.
Deployment Dependencies
- code-server — the upstream project (MIT)
- bon5co/code-server-railway — the Railway wrapper image this template deploys
Implementation Details
Open your deployment's URL and sign in with the generated PASSWORD from the service variables. To change it, edit PASSWORD and redeploy.
Set GIT_REPO to a clone URL to have a repository cloned into /home/coder/project on first boot; it is skipped once that directory holds a checkout, so it never overwrites your work.
HASHED_PASSWORD is supported as an alternative to PASSWORD if you prefer not to store the plaintext value.
Template Content
code-server
ghcr.io/bon5co/code-server-railway:4.134.0