code-server: VS Code in Your Browser, Self-Hosted
code-server turns VS Code into a web application — your editor runs on a server and you access it through a browser, from any device, without installing anything locally. It's the simplest way to self-host a development environment.
What Is code-server?
code-server is an open source project from Coder that packages VS Code as a server application. You install it on a Linux machine, start it, and access the full VS Code interface at a URL.
The result: VS Code running with your files, your extensions, your settings — accessible from any browser on any device, including tablets and phones. The computation happens on the server, so even a low-powered client works fine.
Why Self-Host a Code Editor?
Centralized development environment: Your code, terminals, and dev environment live on one machine. No syncing, no "works on my machine" problems. Start a task on your desktop, continue on a laptop without losing state.
Access from any device: Development from a tablet, a borrowed laptop, or a Chromebook becomes practical. Your browser is the only requirement.
Consistent tooling: One environment means one installation of your language runtimes, build tools, and dependencies. No per-device setup.
Resource offloading: Run compute-intensive builds and tests on a server while working from a lightweight client. Useful when you have a powerful server but a less powerful laptop.
Secure development: Keep sensitive code on your server behind authentication rather than cloning repositories to multiple devices.
Requirements
- A server running Linux (Ubuntu, Debian, Fedora, etc.)
- At least 1 GB RAM (2+ recommended for comfortable use)
- 2+ CPU cores recommended
- Storage appropriate for your codebase
- A domain name or stable IP for access (Cloudflare Tunnel works well for this)
Like what you're reading? Subscribe to Self-Hosted Weekly — free weekly guides in your inbox.
Installation
Direct install (simplest):
curl -fsSL https://code-server.dev/install.sh | sh
This installs code-server as a systemd service. Enable and start it:
sudo systemctl enable --now code-server@$USER
By default, it starts on localhost:8080. Access from the server works immediately. For remote access, set up a reverse proxy.
Docker install:
version: "3"
services:
code-server:
image: lscr.io/linuxserver/code-server:latest
container_name: code-server
environment:
- PUID=1000
- PGID=1000
- TZ=America/Los_Angeles
- DEFAULT_WORKSPACE=/config/workspace
volumes:
- ./config:/config
- /home/youruser:/home/youruser # access your files
ports:
- 8443:8443
restart: unless-stopped
Configuration
The main config file is at ~/.config/code-server/config.yaml:
bind-addr: 127.0.0.1:8080
auth: password
password: your-secure-password-here
cert: false
Key settings:
bind-addr: Use127.0.0.1and put it behind a reverse proxy, or0.0.0.0to expose directly (not recommended without TLS)auth:password(single password) ornone(disable auth — only inside a trusted network)cert: Set totrueto enable built-in TLS, or configure your reverse proxy to handle TLS
Exposing code-server Securely
Option 1: Caddy reverse proxy (simplest HTTPS)
caddyfile
code.yourdomain.com {
reverse_proxy localhost:8080
}
Caddy handles automatic TLS certificates. Point your domain's DNS to your server, and you're done.
Option 2: Cloudflare Tunnel (no open ports)
# Create a Cloudflare Tunnel targeting code-server
cloudflared tunnel create code-server
Configure the tunnel to point to localhost:8080. Your code-server is accessible at a Cloudflare-proxied URL without opening any ports on your router. Useful if you're behind CGNAT or don't want to expose your home IP.
Option 3: VPN access only
If code-server is on your home server, the most secure approach is to access it only over WireGuard or Tailscale. No internet exposure at all — you tunnel in when you need it.
Extensions and Settings Sync
code-server supports most VS Code extensions from the Open VSX Registry (not the official VS Code Marketplace due to Microsoft's terms of service). Most popular extensions are available, but a few Microsoft-proprietary ones are not (including some GitHub Copilot features).
Extensions install exactly like in desktop VS Code: search the Extensions panel and click Install.
Settings sync: code-server supports VS Code's built-in Settings Sync (sign in with GitHub or Microsoft). Your keybindings, settings, and extension list sync across instances.
Performance and Latency
code-server works best on fast, low-latency connections to your server. Over a LAN or local Tailscale connection, it's nearly indistinguishable from running VS Code locally.
Over the public internet with latency over 50-100ms, there's noticeable input lag. This is the primary limitation of browser-based editors compared to native remote development tools (like VS Code's Remote SSH extension running natively on your machine).
If you're traveling and need to access your home server remotely, the latency may be noticeable but workable for most tasks.
Alternatives
| Tool | Model | Best for |
|---|---|---|
| code-server | VS Code in browser | Self-hosting, remote access from any device |
| VS Code Remote SSH | Native VS Code + SSH | Low-latency remote dev from your own machine |
| JetBrains Gateway | JetBrains IDE + remote backend | JetBrains users |
| Gitpod | Cloud dev environments | Ephemeral, per-branch environments |
| GitHub Codespaces | Cloud-hosted VS Code | GitHub-centric workflows |
If you already have VS Code installed and just need remote access to a server, VS Code's built-in Remote SSH extension is often better — lower latency because rendering happens locally, no additional server setup, and full VS Code Marketplace access. code-server's advantage is truly zero-setup browser access from any device.
When code-server Makes Sense
Use code-server if:
- You want to code from devices that don't have VS Code installed (tablets, shared computers)
- You're building a shared development environment (small team, all using the same server)
- You want a consistent, single development environment across devices
- You're setting up a lab environment where everything runs on a central server
Consider VS Code Remote SSH instead if:
- You always work from your own machine with VS Code installed
- Low input latency is a priority
- You need full VS Code Marketplace extension access
