Warning: This is a tl:dr; YYMV, RTFM, use at your own risk etc.
- Ubuntu 24.04
- Tailscale installed with MagicDNS and HTTPS enabled.
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
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
}
TS_PERMIT_CERT_UID=caddy
https://tailscale.com/kb/1190/caddy-certificates
sudo setcap cap_net_bind_service=+ep $(which caddy)
sudo systemctl reload caddy
sudo systemctl reload tailscaled