---
title: "Deploy code-server Node.js"
description: "Browser VS Code for Node.js apps with port proxying"
category: "Other"
url: https://railway.com/deploy/deploy-code-server-for-nodejs
---

# Deploy code-server Node.js

Browser VS Code for Node.js apps with port proxying

**[Deploy code-server Node.js on Railway](https://railway.com/template/deploy-code-server-for-nodejs)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-code-server-for-nodejs/manifest.json

- **Creator:** onepush
- **Category:** Other

## Template content

### code-server

- **Image:** codercom/code-server:4.141.0@sha256:72ab24b5680ee597dd647b30d82625752f40109b5f61bef90ffbf1ea1f02dbb8
- **Start command:** `/bin/sh -c 'set -e; W="${DEFAULT_WORKSPACE:-/home/coder/workspace}"; if [ "$(stat -c %u /home/coder)" != 1000 ]; then cp -an /etc/skel/. /home/coder/; chown -R 1000:1000 /home/coder; echo "volume: /home/coder handed to coder (uid 1000)"; fi; runuser -u coder -- mkdir -p "$W" "${ENTRYPOINTD:-/home/coder/.entrypoint.d}"; exec runuser -u coder -- /usr/bin/entrypoint.sh --bind-addr 0.0.0.0:8080 --disable-telemetry --enable-remote-storage "$W"'`
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted code-server Node.js (Browser VS Code for Node.js) on Railway

This template runs VS Code in your browser on a box you control, with Node.js and dev servers reachable through the built-in port proxy.

## About Hosting code-server Node.js open-source software on Railway (self hosted code-server for Node.js development template)

This template runs one code-server 4.141.0 container on the official codercom/code-server image, pinned by tag and digest.

Start `npm run dev` on port 3000 and it is reachable at https://your-domain/proxy/3000/ behind the same login.

## Why Deploy code-server Node.js, the GitHub Codespaces alternative on Railway (Railway Free Trial)

Codespaces bills by compute and storage on GitHub's infrastructure, while this gives you one always-on container for a flat monthly cost that you control.

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 Node.js 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.

### Railway vs Other Hosting Providers and VPS for code-server Node.js self hosting

A VPS gives you full control of the box, while Railway runs the editor for you.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | A deploy from the official codercom/code-server image, a home volume, and a public HTTPS domain. | A Droplet you size and patch yourself, with root access and your own reverse proxy. |
| AWS | One service with a volume and public domain, and a flat bill for one always-on editor. | Deep control over networking and storage, but EC2 or ECS, TLS, and backups are on you. |
| Hetzner | A managed deploy with the password and home volume already connected. | Low-cost servers with generous resources, but you install code-server and handle HTTPS yourself. |

If you want full control over the box, a VPS is the better fit, and Railway is for when you just want the editor running.

## Common Use Cases for hosted code-server Node.js

- **Node.js work from a Chromebook or iPad:** You open the editor in Safari or Chrome and run your Node toolchain on the server, so the tablet only needs a browser and a keyboard.
- **Previewing a dev server through /proxy/PORT:** Start `npm run dev` on port 3000 in the terminal, then open https://your-domain/proxy/3000/ behind the same login to see the app without exposing another port.
- **Keeping node_modules and nvm on the volume:** Install nvm and Node into /home/coder, and they survive redeploys along with your project folder, so you skip reinstalling everything after each restart.
- **Debugging with the VS Code debugger:** Set breakpoints in your server code and use the built-in debugger in the browser, which works the same as it does on a desktop install.
- **A shared dev box for a small team:** Your team can point everyone at one hosted environment with a shared password, though remember anyone with that password gets full terminal access.

## Dependencies for code-server Node.js Docker hosted on Railway

This template is one container built from the official codercom/code-server image, with nothing custom on top.

### Deployment Dependencies for Managed code-server Node.js Service (Cloud IDE)

You need a Railway project with the code-server service running codercom/code-server:4.141.0 (VS Code 1.141.0), pinned by tag and digest.

### Implementation Details for code-server Node.js (Using code-server official docker image)

The container starts as root only long enough to hand the volume to the coder user (uid 1000), then drops privileges.

```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR="$HOME/.nvm"
. "$NVM_DIR/nvm.sh"
nvm install --lts
```

Packages installed with apt disappear on redeploy, so put those commands in an executable script in ~/.entrypoint.d (chmod +x) and they rerun on every boot.

## How does code-server Node.js compare against other cloud IDEs for JavaScript

### code-server Node.js vs GitHub Codespaces (Cloud IDE Alternative)

- **Who runs it:** GitHub hosts Codespaces and bills you by compute and storage. Here you run one container on your own Railway project, so the monthly cost is flat infrastructure rather than per-hour seats.
- **Where Codespaces wins:** It gets you to a working environment in seconds, with prebuilt devcontainers and tight GitHub integration. Our template needs a volume and a first boot to be useful.
- **Node tooling:** Both let you install nvm and Node into your home directory, which persists here because only /home/coder survives redeploys.

### code-server Node.js vs StackBlitz (Browser Web Playground Alternative)

- **Scope:** StackBlitz is built for running small web projects instantly with no setup. It is a playground, not a full remote machine.
- **Where StackBlitz wins:** Zero-config previews of front-end starter kits are hard to beat for demos and quick experiments.
- **Where code-server wins:** You get a real shell, your own repo, a long-running npm run dev, and the full VS Code debugger.

### code-server Node.js vs Gitpod (Hosted Dev Environment Alternative)

- **Model:** Gitpod is a hosted cloud development service with usage-based billing. This template is a single always-on box you own.
- **Where Gitpod wins:** Its per-workspace automation and prebuilds are more polished for teams spinning up many environments.
- **Port access:** Gitpod exposes ports through its own URLs, while here your dev server on port 3000 sits behind the same login at /proxy/3000/.

### code-server Node.js vs VS Code Remote SSH (Local Desktop Editor Alternative)

- **Setup:** Remote SSH connects a local desktop VS Code to a remote machine over SSH. You need a desktop client and SSH keys, but no browser tab.
- **Where Remote SSH wins:** It feels native on a laptop and supports every extension the desktop client can run.
- **Where code-server wins:** It works on an iPad or a Chromebook with no client install, and your Vite or Next dev server is reachable from any browser.

## How to use code-server Node.js (the OSS browser IDE)?

1. Open your public domain and log in with the PASSWORD value from the Variables tab. You land in /home/coder/workspace.
2. Open a terminal and install nvm and Node into your home directory so they survive redeploys.
3. Clone your repo, run npm install, then start the dev server on port 3000.
4. Open https://your-domain/proxy/3000/ in a new tab. If your app needs a base path (Vite or Next), use /absproxy/3000/ and match the framework's base path exactly.
5. For apt packages, put an executable script in /home/coder/.entrypoint.d so it reinstalls on every boot.

```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install --lts

git clone https://github.com/you/your-app.git
cd your-app
npm install
npm run dev -- --port 3000

cat &gt; ~/.entrypoint.d/10-apt.sh &lt;&lt;'EOF'
#!/bin/sh
sudo apt-get update &amp;&amp; sudo apt-get install -y libvips-dev
EOF
chmod +x ~/.entrypoint.d/10-apt.sh
```

## How to self host code-server Node.js on other VPS Services (code-server self hosting guide)

Running this on your own VPS is less work than it sounds.

### Clone the Repository

Skip cloning code-server itself, since it ships as an install script or a Docker image.

```bash
git clone https://github.com/your-org/your-node-app.git
```

### Install Dependencies

Install code-server with the official script, then Node into your home directory with nvm so it survives restarts.

```bash
curl -fsSL https://code-server.dev/install.sh | sh
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
nvm install --lts
```

### Configure Environment Variables

Set a password in `~/.config/code-server/config.yaml` and bind to localhost.

### Start the code-server Node.js Application

Run `code-server`, open https://your-domain, and reach your app at https://your-domain/proxy/3000/.

## Official Pricing of code-server Node.js (code-server pricing)

code-server is free and open source under the MIT license, so there is no license fee to pay.

## code-server Node.js cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting code-server Node.js comes down to two things: your monthly bill and how much RAM your dev server and npm installs can eat.

### Monthly cost of self hosting code-server Node.js on Railway

On Railway, one always-on code-server at light to moderate use runs roughly $5-15 per month, depending mostly on RAM.

### System Requirements for Hosting code-server Node.js on a VPS

Plan on 1-2 GB of RAM for VS Code with language servers, and more for large TypeScript monorepos.

## Frequently Asked Questions (FAQs)

### Does Node survive a redeploy?

Only /home/coder persists, so if you install nvm and Node into your home directory they survive redeploys.

### What is the difference between /proxy and /absproxy?

/proxy/3000/ strips the prefix, so your app should use relative URLs. /absproxy/3000/ passes the path through unchanged, which you need when your framework expects a specific base path.

### How do I handle Vite or Next base paths?

Pick the /absproxy route and set the framework's base path to match it exactly, such as /absproxy/3000/.

### Does hot reload work through the proxy?

Hot reload uses WebSockets, and the proxy supports them, so HMR should work through /proxy or /absproxy.

### Will npm installs run out of memory?

They can, because the editor, terminals, and your dev server share one container.

### Can I install global CLIs?

Yes, as long as you install them under your home directory, for example with nvm's global prefix, so they persist.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/deploy-code-server-for-nodejs
