Visual Studio Code on iPad with Tailscale and code-server

I’ve been learning Elixir recently, primarily as an excuse to futz around and set up a development environment using my iPad Air (with “Smart Keyboard Folio”).

I can’t believe this works as well as it does.

The two technologies that are key to making this work are code-server and Tailscale. Essentially I just followed the very detailed instructions provided by the folks at Tailscale to set up code-server and Tailscale on an EC2 instance. I tried to follow the Coder instructions for setting up HTTPS via Let’s Encrypt + nginx, but ended up having to manually edit my nginx config to get it to work (see below).

The truly amazing thing about doing it with Tailscale is that the EC2 instance has no public IP and its security group has no inbound rules at all, but all I have to do is just flip Tailscale to “On” on my iPad and I can immediately connect to it. It feels like magic.

Now that it’s working, using VSCode on the iPad is pretty great, provided you do the Progressive Web App installation trick of first loading it in Safari and then adding it to your home screen.

Tips

server {
  listen 443 ssl;
  server_name <Tailscale DNS hostname>;

  ssl_certificate       /var/lib/tailscale/certs/<Tailscale DNS hostname>.crt;
  ssl_certificate_key   /var/lib/tailscale/certs/<Tailscale DNS hostname>.key;

  <snip>
}