You’re on a tablet, or a borrowed laptop, or a Chromebook — and you need to code. Instead of installing an editor and setting up your environment from scratch, what if you could open a browser tab and be dropped straight into VS Code, with all your projects and extensions already there? That’s code-server.

This guide shows you how to self-host it with Docker. It’s the ultimate “code from anywhere” setup, and a perfect fit for a homelab.

What is code-server?

code-server is VS Code, running on a server and served to your browser. You get the full editor — extensions, terminal, Git integration — but it executes on your server, not your laptop.

It’s an official open-source project, not a hack: the same VS Code you know, just remote.

Why self-host code-server?

  • Code from any device. A browser is all you need.
  • One consistent environment. Your extensions, themes, and settings follow you.
  • Use a more powerful machine. Run your editor on a beefy server while you sit on a lightweight laptop.
  • Your code stays on your hardware. Nothing leaves your server unless you push it.

What you need

  • A mini PC or VPS with Docker.
  • Enough RAM for your projects — 2 GB is a reasonable minimum, more if you run heavy builds.

Step 1: Create the Docker Compose file

services:
  code-server:
    image: lscr.io/linuxserver/code-server:latest
    container_name: code-server
    restart: always
    ports:
      - "8443:8443"
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Ho_Chi_Minh
      - PASSWORD=your-strong-password
    volumes:
      - ./config:/config

The config volume holds your projects and settings, so they survive restarts.

Step 2: Start it

docker compose up -d

Open http://your-server-ip:8443, enter your password, and VS Code loads in the browser.

Step 3: Put it behind HTTPS

A password alone isn’t enough over plain HTTP. Put code-server behind Caddy for a real certificate:

code.example.com {
    reverse_proxy localhost:8443
}

Now you have https://code.example.com with a valid certificate and an encrypted connection.

Using it day to day

  • Install extensions from the marketplace, just like desktop VS Code.
  • Open a terminal with Ctrl+~ — it’s a shell into your server.
  • Clone repos directly into your projects folder.

Because it runs on your server, long-running tasks keep going even if you close the tab.

Why code-server over a local editor

A local editor runs on whatever machine you’re sitting at — a laptop that might be slow, low on storage, or not even yours. code-server flips that: the editor runs on your server, which you spec up once and forget. The device in front of you becomes a thin terminal that only needs a browser.

This matters in three common situations. First, traveling with a lightweight device like a Chromebook or a tablet. Second, keeping one consistent environment across a desktop, a laptop, and a borrowed machine. Third, running heavy builds on hardware with more RAM and cores than your laptop has. In every case, code-server means you never set up your environment twice.

Extensions, themes, and settings

code-server installs extensions from the same marketplace as desktop VS Code, and the vast majority work identically. Your settings, keybindings, and themes live in the config volume, so they survive container restarts and updates.

A handful of extensions rely on local OS features and won’t behave the same in the browser — anything that spawns native windows, for example. For the overwhelming majority of day-to-day development, though, you won’t notice a difference.

Use it as a remote build machine

Because code-server is essentially a shell into your server, you can run long builds, tests, and data-processing jobs directly in the integrated terminal — and close your laptop without killing them. The job keeps running on the server, and you reconnect later to see the result.

That makes it a perfect companion to a beefy homelab box: write code from anywhere, but let the heavy lifting happen on hardware that isn’t sitting on your lap.

Security hardening

code-server is a full shell, so treat it like one. Beyond a strong password and HTTPS, consider:

  • Change the port from the default if you’re exposing it publicly.
  • Restrict access — ideally keep it on a private network like Tailscale rather than the open internet.
  • Disable telemetry in settings if you don’t want usage data reported.

A little caution goes a long way: this container can run anything you can run in a terminal.

Sync your work with Git

code-server’s biggest workflow win is Git. Clone your repos directly into the container, work in the browser, and push when you’re done — your code always lands in a remote, not trapped on a single machine.

Pair code-server with a self-hosted Git server and you’ve got a complete, private development environment: editor, shell, and version control, all on hardware you own.

Common mistakes to avoid

  • Using a weak password — code-server is a full shell, so treat it like a server login.
  • Skipping HTTPS — never expose it over plain HTTP.
  • Storing everything in the container — use the config volume so your work persists.

FAQ

Is code-server as good as desktop VS Code?

For most workflows, yes. A few extensions that need a local GPU or OS integration behave differently, but the core experience is identical.

Can I use it from a phone?

Technically yes, but it’s best with a keyboard and a real screen. A tablet with a keyboard is great.

Does code-server use my server’s resources?

Yes — code runs on your server, so the CPU and RAM of your device barely matter.

The bottom line

code-server turns any browser into a full development environment, backed by your own server. If you already run a homelab, it’s one of the highest-leverage containers you can add — your entire dev setup, available anywhere, for free.