Log inSign up

A browser-based VS Code workspace on your server

Run the official install script with curl -fsSL https://code-server.dev/install.sh | sh, start it with sudo systemctl enable --now code-server@deploy, and keep it bound to 127.0.0.1:8080. Set a strong password in ~/.config/code-server/config.yaml, then publish code.example.net through Caddy or Nginx with HTTPS. You get the VS Code editor, terminal and extensions in any browser, with the code living on the server.

Topic: Self-hosted apps · Tested on: Ubuntu 24.04 and 22.04, Debian 12 and 13 · Updated 2026-12-03

Why run code-server on a VPS?

code-server packages the open source core of VS Code as a web app. Your files, compilers and terminal sessions stay on the server, and any device with a browser becomes the editor: a tablet, a borrowed laptop or a thin client. Builds run on server CPUs and the editor keeps state between devices.

Because whoever logs in gets a shell as your user, treat it like SSH access. Run it under a normal sudo user such as deploy (see create a sudo user), never as root, and protect it with HTTPS plus a long password or a login gateway.

A plan with 2 GB of memory handles editing and light builds; language servers for large TypeScript, Java or Rust projects push that toward 4 GB or more.

How do you install code-server?

Use the project install script, which detects Debian or Ubuntu and installs the latest release as a .deb package. Preview what it will do first with --dry-run.

curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
curl -fsSL https://code-server.dev/install.sh | sh
code-server --version

The script asks for your sudo password to install the package. If you prefer not to pipe a script into a shell, download the code-server_VERSION_amd64.deb file from the GitHub releases page and install it with sudo apt install ./code-server_*_amd64.deb; the result is identical.

How do you run it as a service and set the password?

The package includes a systemd template unit that runs code-server as the user named after the @. Start it once to create the config file, then edit the password and address.

sudo systemctl enable --now code-server@$USER
sleep 2
nano ~/.config/code-server/config.yaml
bind-addr: 127.0.0.1:8080
auth: password
password: use-a-long-random-passphrase-here
cert: false
chmod 600 ~/.config/code-server/config.yaml
sudo systemctl restart code-server@$USER
systemctl status code-server@$USER --no-pager
ss -tlnp | grep 8080

The ss line must show 127.0.0.1:8080. To avoid a plain-text password, replace the password: line with hashed-password: and an Argon2 hash, as described in the code-server FAQ. For the passphrase itself, openssl rand -base64 24 produces a strong random value.

How do you publish code-server over HTTPS?

Terminate TLS in a reverse proxy that passes WebSockets; the editor uses them for the terminal and live file events. With Caddy:

code.example.net {
    reverse_proxy 127.0.0.1:8080
}

With Nginx, save this block and run Certbot on it:

server {
    listen 80;
    listen [::]:80;
    server_name code.example.net;
    location / {
        proxy_pass http://127.0.0.1:8080/;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
        proxy_set_header Accept-Encoding gzip;
    }
}
sudo nginx -t && sudo systemctl reload nginx
sudo certbot --nginx -d code.example.net
sudo ufw allow 80,443/tcp

Open https://code.example.net, enter the password and the editor loads. Without HTTPS, browsers block clipboard access and some webviews, so always use the TLS address. The Caddy tutorial and Certbot guide cover each proxy in detail.

How do you add a second layer of protection?

Put a login gateway or a network restriction in front so the password is not the only barrier. Two simple options:

  • Forward auth: protect code.example.net with Authelia and set auth: none in code-server, so the gateway with two-factor is the single login.
  • Private access: leave the proxy off entirely and reach the editor through an SSH tunnel, ssh -L 8080:127.0.0.1:8080 deploy@198.51.100.24, then browse to http://localhost:8080 on your machine.

Also install fail2ban or similar to slow password guessing if the login page is public; code-server already rate limits attempts, but extra layers are cheap.

How do you install extensions and tools?

Extensions come from the Open VSX registry by default. Search in the Extensions panel, or install from the command line:

code-server --install-extension ms-python.python
code-server --install-extension esbenp.prettier-vscode
code-server --list-extensions

A few extensions published only to the Microsoft marketplace are not available there; their .vsix files can be installed with --install-extension ./file.vsix where the licence permits. Install the language toolchains on the server itself, for example with the Node.js or Python guides, since the editor runs them there.

How do you update code-server?

Run the install script again; it replaces the package with the newest release. Then restart your service.

curl -fsSL https://code-server.dev/install.sh | sh
sudo systemctl restart code-server@$USER
code-server --version

Settings, extensions and the workspace live under ~/.config/code-server and ~/.local/share/code-server, so updates keep them. Include those folders and your project directories in backups, for example with the daily backups add-on or restic.

What are common code-server problems?

  • Blank page or reconnect loop: the proxy is not passing WebSocket upgrades. Check the Upgrade and Connection headers.
  • "Address already in use": another app owns port 8080. Change bind-addr to 127.0.0.1:8443 and update the proxy.
  • Editor slow or killed: language servers ran out of memory. Watch free -h, add a swap file, or move to a bigger plan.
  • Service fails at boot: read journalctl -u code-server@deploy -n 50; a YAML typo in the config is the usual cause.

Plans that fit this guide

Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.

All prices
PlanFits becauseSizeMonthlyOrder from
A1-2editing and small scripts1 vCPU, 2 GB RAM, 50 GB NVMe$7.20/mo$43.20 for 6 months
A2-4web projects with language servers2 vCPU, 4 GB RAM, 100 GB NVMe$14.40/mo$43.20 for 3 months
F4-16large builds and heavy toolchains4 vCPU, 16 GB RAM, 384 GB NVMe$57.60/mo$57.60 for 1 month

Questions about VS Code in the browser (code-server)

Is code-server the same as VS Code?

It is built from the open source VS Code code base, so the editor, settings and most extensions behave the same. Some proprietary Microsoft features and extensions are not included.

Can several people share one code-server?

Each instance is one user account with full shell access. For several people, run one service per Linux user (code-server@alice, code-server@bob) on different ports.

Can I use it from a phone or tablet?

Yes, it runs in mobile browsers, and it can be installed as a progressive web app for a full-screen window. A hardware keyboard makes it practical.

Does code-server need outgoing mail?

No. It sends no email. Git commit notifications and similar come from your Git host, not from the editor.

Which plan suits code-server?

For scripting and web projects a 2 GB plan is comfortable. Heavy builds and large language servers benefit from 4 to 8 GB and more vCPU.