Skip to content

Instantly share code, notes, and snippets.

@withakay
Last active July 25, 2025 18:24
Show Gist options
  • Select an option

  • Save withakay/701826c36b7aa705e57157a36de24fcc to your computer and use it in GitHub Desktop.

Select an option

Save withakay/701826c36b7aa705e57157a36de24fcc to your computer and use it in GitHub Desktop.
Private browser based VS Code on Ubuntu, Tailscale using coder-server

coder-server: Remote browser based VS Code on Ubuntu with Tailscale

Warning: This is a tl:dr; YYMV, RTFM, use at your own risk etc.

Requirements

  • Ubuntu 24.04
  • Tailscale installed with MagicDNS and HTTPS enabled.

Install Coder

https://coder.com/docs/code-server/install#installsh

curl -fsSL https://code-server.dev/install.sh | sh

https://coder.com/docs/code-server/guide#using-lets-encrypt-with-caddy

Install Caddy

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

Replace /etc/caddy/Caddyfile with the below (using sudo), adding your own tailscale MagicDNS name.

your-personal.ts.net {
  reverse_proxy 127.0.0.1:8080
}

or if you want to map to a route

your-personal.ts.net/code/* {
  uri strip_prefix /code
  reverse_proxy 127.0.0.1:8080
}

Allow caddy user to update tailscale certs

TS_PERMIT_CERT_UID=caddy

https://tailscale.com/kb/1190/caddy-certificates

Allow caddy to bind to reserved port (i.e. 443)

sudo setcap cap_net_bind_service=+ep $(which caddy)

Reload

sudo systemctl reload caddy

sudo systemctl reload tailscaled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment