LIVEReading: Run VS Code in Your Browser on Any MachineTotal time: 8 minSteps: 6Worked first time: 72% LIVEReading: Run VS Code in Your Browser on Any MachineTotal time: 8 minSteps: 6Worked first time: 72%
CBW
Run VS Code in Your Browser on Any Machine
Mediumgithub.com/coder/code-server2026-06-17

Run VS Code in Your Browser on Any Machine

code-server lets you run a full VS Code editor in any browser tab. Set it up on a Linux server and code from any device — phone, tablet, or old laptop.

// Build stats

  • Total time8 min
  • Number of steps6
  • DifficultyMedium
  • Worked first time72%
// Before you start

What you need

  • A Linux machine or VPS (Ubuntu 20.04+ recommended) with at least 1 GB RAM and 2 vCPUs
  • SSH access to that machine (or an open terminal on it)
  • Port 8080 open in your firewall or security group
  • A modern browser on the device you want to code from
01
Step 1 of 6

Preview the install script before running it

1 min

Before you run any script from the internet, it is smart to see what it will do. This dry-run flag prints every action the installer would take without actually changing anything on your machine.

Terminal · mac
$ curl -fsSL https://code-server.dev/install.sh | sh -s -- --dry-run
What you should see
A list of steps the installer plans to take — package manager detection, download URL, and install path. No files are changed yet.
This might happen

curl: command not found

Run: sudo apt-get install -y curl then retry the command.

02
Step 2 of 6

Install code-server

3 min

This runs the official install script for real. It detects your Linux distribution, downloads the right package, and installs code-server using your system's package manager. You do not need to pick a version — it grabs the latest stable release.

Terminal · mac
$ curl -fsSL https://code-server.dev/install.sh | sh
What you should see
Lines showing the download progress, then a message like 'Installed code-server vX.X.X' followed by instructions for starting it.
This might happen

Permission denied errors during install

The script needs sudo for some steps. If it fails, re-run with: curl -fsSL https://code-server.dev/install.sh | sudo sh

03
Step 3 of 6

Start code-server and keep it running

1 min

This enables code-server as a background service that starts automatically when your machine reboots, then starts it right now. systemctl is the standard Linux service manager — you are just registering and launching the app.

Terminal · mac
$ sudo systemctl enable --now code-server@$USER
What you should see
A line like 'Created symlink ... code-server@yourname.service'. No errors means it is running.
This might happen

Failed to enable unit: Unit file not found

The install may not have finished cleanly. Run: sudo apt-get install -y code-server then retry this step.

04
Step 4 of 6

Find your auto-generated password

1 min

code-server protects itself with a password on first run. It stores that password in a config file in your home directory. This command prints the config so you can copy the password before opening the browser.

Terminal · mac
$ cat ~/.config/code-server/config.yaml
What you should see
A few lines including: bind-addr: 127.0.0.1:8080, auth: password, and password: someRandomString
This might happen

No such file or directory

The service may not have started yet. Wait 10 seconds and try again, or check status with: sudo systemctl status code-server@$USER

05
Step 5 of 6

Open VS Code in your browser

1 min

By default code-server only listens on localhost (127.0.0.1), which means you can only reach it from the same machine. If you are on that machine, open the URL below directly. If you are connecting remotely over SSH, use SSH port-forwarding in a second terminal on your local computer to tunnel port 8080 safely to your laptop.

Terminal · mac
$ ssh -L 8080:127.0.0.1:8080 YOUR_SERVER_USER@YOUR_SERVER_IP -N
What you should see
The terminal hangs silently — that is correct. It is holding the tunnel open. Now open http://localhost:8080 in your local browser.
This might happen

Browser shows 'connection refused' or the page never loads

Make sure the SSH tunnel command is still running in its terminal. Also confirm code-server is active: sudo systemctl status code-server@$USER

06
Step 6 of 6

Log in with your password

1 min

The browser will show a simple password prompt. Paste the password you found in Step 4. After that you land in a full VS Code interface running on your server.

Terminal · mac
$ # No command needed — paste the password from Step 4 into the browser prompt
What you should see
A full VS Code editor loads in the browser tab. You can open folders, install extensions, and use the integrated terminal — all running on your server.
// Status

cooked. baked. worked.

A fully functional VS Code editor running in your browser, backed by your Linux server's CPU and storage. You can code from any device without installing anything locally.

// the honest bit

The honest part

By default code-server is only accessible on localhost for security reasons. Exposing it directly to the internet on port 8080 without HTTPS and a strong password is risky — do not do it. For permanent remote access, the official docs recommend putting it behind a reverse proxy (like nginx) with a TLS certificate. That requires some server admin work beyond this guide. Also, a few VS Code extensions (especially proprietary Microsoft ones like Copilot) do not work in code-server because they are locked to the official VS Code marketplace.