About a year ago I blogged about how to turn iPad Pro into a capable coding machine with the help of a remote linux server.

Since then several things have happened:

  1. New version of iPad Pros were released with the amazing Magic Keyboard that is easier to type on, has trackpad and back-lighting, making iPads way nicer for prolonged, serious work.
  2. Apple has started limiting background applications to 15 minutes of activity. This creates certain level of annoiance for any SSH client, including the ones described in my blog post (Mosh is much less effected by it, however).

Thankfully, there’s a new, very interesting way to code on iPads using an editor that is a derivative of everybody’s favorite Visual Studio Code. The VS Code itself, being a Javascript (well, TypeScript) program, obviously does not run natively on iPad (and probably won’t any time soon), but there’s an open-source project code-server that allows you to run, what basically is VS Code, as a server over HTTP(S) and to securely connect to it in Safari browser.

Note: since the server runs in foreground, you probably want to launch it with tmux (e.g. tmux new -s coder-server) or screen, so it doesn’t hang up once you disconnect, from your server.

But other than that - all it takes is to:

  1. Download the latest tar.gz file from the project releases page with: wget https://github.com/cdr/code-server/releases/download/3.2.0/code-server-3.2.0-linux-x86_64.tar.gz
  2. Extract it with tar xzvf code-server-3.2.0-linux-x86_64.tar.gz
  3. Choosing a custom port of your liking (unless you want to run on the default 8080, but I would not recommend it). Let’s say we like 9797
  4. Opening that port up in the firewall with sudo ufw allow 9797 (or: preferrably proxying using Caddy server to https)
  5. Run it on any port of your choosing, say with ./code-server --bind-addr
  6. Opening the address like where we assume that IP is of your server.
  7. Entering the password you have been given during the server startup (for security), and enjoying your new awesome IDE.

To make sure you don’t have to always start the app from Safari, on your iPad, just click on “share” when you have it first opened in safari, and then scroll down to “Add to Home Screen” to turn the website into an “app”.

Once all is done, you should have something like the setup on the following screenshot:

You may want to also configure HTTPS for your setup, once you know you like it enough to actually use it regularly. Using Caddy Server’s automatic HTTPS via Let’s Encrypt is easier for this, in my opinion, than dealing with certificates yourself.

Thanks to Safari being first-class citizen on iPadOS, your app-ized “VS Code” will be able to even use split-screen functionality! And obviously, VS Code has built-in terminal app, so you don’t even have to set up a separate terminal app or worry about it disconnecting.

Pretty sweet!

P.S. I wrote this blog using the setup described :)