September 4th, 2024

Coding on iPad using self-hosted VSCode, Caddy, and code-server

This guide explains setting up coding on an iPad using VSCode, code-server, and Tailscale for secure access, requiring an Ubuntu server and configuration adjustments for security and functionality.

Read original articleLink Icon
Coding on iPad using self-hosted VSCode, Caddy, and code-server

This guide outlines how to set up coding on an iPad using Visual Studio Code (VSCode), Caddy, and code-server, facilitated by Tailscale for secure access. VSCode is favored for its speed and extensive extensions, while code-server allows users to run VSCode on a server and access it from any device, including an iPad. Tailscale provides a secure connection, eliminating the need for public-facing proxies. The setup requires an iPad or laptop, a server (preferably running Ubuntu 20.04), and a Tailscale account. The process involves installing Tailscale on the server, followed by code-server, and configuring it to be accessible via Tailscale. Users must adjust the code-server configuration to allow access only through Tailscale, removing password authentication. Finally, Tailscale is installed on the iPad, allowing access to the VSCode instance via the server's Tailscale IP. Additional steps include setting up HTTPS for enhanced functionality and implementing firewall settings to restrict access to the server. This setup enables coding from various locations while ensuring security through Tailscale.

- Tailscale allows secure access to code-server from an iPad.

- The setup requires an Ubuntu server and a Tailscale account.

- Code-server must be configured to allow access only through Tailscale.

- HTTPS can be set up for enhanced functionality using Let's Encrypt.

- Firewall settings can be adjusted to restrict server access to Tailscale only.

Link Icon 20 comments
By @jsheard - 5 months
It's a sad state of affairs that the iPads are so incredibly powerful, with the exact same silicon as MacBooks, and yet to do real development work on one you have to reduce it to the worlds most expensive thin client connected to a real computer somewhere else.
By @napkin - 5 months
I’ve been maining an M4 iPad Pro for a few months now since frying my laptop (which ran Linux) while travelling. There’s a lot to love about it.

Sadly, one discovers dozens of minor bugs and annoyances, that are mostly specific to doing productivity/dev work.

For example, when I use Cmd-Tab to switch tasks, there’s a ~ 1/20 chance that the Cmd key will become ‘soft-stuck’. That is, I’ll start typing and the OS will act as if I’m holding down Cmd, often messing with my browser or active project. I have to tap Cmd again to ‘unstick’ it. It’s not a hardware issue- An Apple store has already replaced the keyboard for me, and the problem persists.

I guess no one at Apple dogfoods the iPad for productivity? Which is sad, because here this thing is! It exists! Productivity features have been at least added to iOS!

On the plus-side, I’m getting deep into doing sound synthesis / music production in iOS. The ecosystem is kind of exciting. I spend most of my time inside Audulus (Max/PD-like data flow/DSP) - it is criminally underrated, and so much fun.

I could really go on about the pros and cons but will refrain. It’s just such a mixed bag.

By @xnyan - 5 months
This is ultimately why I returned my M4 iPad pro. Amazing hardware that's so limited by restrictive policy that it amounts to little more than a fancy dumb terminal.
By @parallaxapps - 5 months
If you want to develop on an iPad, we're building WebForge IDE: a web IDE for iOS.

Rich text editor, run PHP and NodeJS on device, manage Git repos, and view your projects in a built-in browser that includes dev tools.

Check it out! https://apps.apple.com/us/app/webforge-ide/id6450872424

EDIT: Web Development IDE, not web-based IDE. Thanks for pointing that out! :)

By @hiatus - 5 months
Kind of a tangent but my biggest blocker to adopting an iPad workflow is the lack of support for a customizable keyboard layout. Does anyone know any app or something that allows this or non-canonical layouts impossible on iPad?
By @westurner - 5 months
Is it ergonomic to code on a tablet without bci?

https://vscode.dev can connect to a remote vscode instance in a container e.g. over Remote Tunnels ; but browsers trap so many keyboard shortcuts.

Which container with code-server to run to connect to from vscode client?

You can specify a development container that contains code-server with devcontainer.json.

vscode, Codespaces and these tools support devcontainer.json, too:

coder/envbuilder: https://github.com/coder/envbuilder

loft-sh/devpod: https://github.com/loft-sh/devpod

lapce/lapdev: https://github.com/lapce/lapdev

JupyterHub and BinderHub can spawn containers that also run code-server. Though repo2docker and REES don't yet support devcontainer.json, they do support bringing your own Dockerfile.

By @bee_rider - 5 months
Coding on an iPad is pretty nice. They have, IIRC, the better 4:3 aspect ratio. Much less awkward than a typical 16:9 laptop in portrait mode.

VSCode, I dunno. It is nice to be accessible. It seems like a poor replacement for tmux+vim, which runs happily over bog standard ssh.

By @laweijfmvo - 5 months

  > There are a few caveats to coding on an iPad.
Well, thanks for being specific...
By @tonymet - 5 months
I've attempted this with various terminal emulator / SSH apps, Cloud-9 (now part of AWS, VS Code

The major issue is that apps & tabs are evicted unexpectedly. Any time you content switch, the app has a chance to be killed.

Of course there are mobile terminals , tmux and other tools to mitigate it, but it's still a major pain.

If I'm going ultra-light, I carry a raspberry pi + bt keyboard . Otherwise a laptop is preferred.

By @vsuperpower2021 - 5 months
I always wondered what would happen when the ipad kids grew up. Can't say I expected them to start trying to use it to program.
By @abusaidm - 5 months
Since VSCode can be installed as a PWA on chrome, is it installable on iPad as a PWA app to use from the desktop and avoid pressing back to a webpage?

Also interested how it handles when network is lagging. Is the input laggy or does it smooth on the client and it syncs once network stable things sync?

By @chadsix - 5 months
You can also do this with 1-click and no effort using Cloud Seeder [1]

[1] https://github.com/ipv6rslimited/cloudseeder </shameless>

By @laweijfmvo - 5 months
Setting up a github Codespace allows you to use VSCode inside a browser, and in my limited testing, it worked OK. Wouldn't want to use it full time, though.
By @bilsbie - 5 months
I’m looking for a tablet coding solution.

I’ve just been hating siting at a desk for any period of time. I can’t figure out what it is about a desk. Maybe it’s an adhd thing?

By @caeril - 5 months
Wow, that's a lot of work when you could just ssh in from Blink or Termius and launch neovim, like someone sane would do.

What is the actual use-case of this?

By @minkles - 5 months
So basically you're not doing all the coding on the iPad.
By @geniium - 5 months
Every now and then I see post like this.

Am still surprised there isn’t a solution to make the iPad a real dev machine.

Apple must really not want us to do this.