By: [email protected]

Published November 14, 2024 at 03:05 AM

The iPad - The Ultimate Development Machine?

Explore how to transform an iPad into a powerful development tool using VS Code Server, turning it into a surprisingly capable, portable coding setup. Perfect for quick fixes on the go, this guide walks through everything from setup to real-world coding tips on an iPad!

The iPad - The Ultimate Development Machine?

Introduction

I've always been a bit obsessed with the iPad. I could never justify getting one, but I always loved the idea of using it as a travel computer.

Don't get me wrong – I truly love my 16-inch MacBook Pro, but lugging that beast around, especially for short trips? No thanks. Most of the time I don't even plan to code, I just need it in case I need to make a quick change / emergency fix.

That said, there's a big deal breaker - the iPad doesn't support actual coding!

For years, this has been the dealbreaker. While there are plenty of code editor apps in the App Store, none of them really cut it for serious development work. They lack many, I would say necessary features, like say running Python or giving you access to a terminal.

HOWEVER, thanks to VS Code Server, I’ve finally cracked the code (pun intended) on turning the iPad into a legitimate development machine.

Setting Up a Remote Development Environment

The Building Blocks

Here's the secret sauce: instead of trying to run a full development environment on the iPad itself, we're essentially turning it into a thin client that connects to your main development machine. The star of the show is VS Code Server, but the supporting cast is equally important.

The foundation of this setup relies on three main components:

  1. VS Code Server running on your main development machine (in my case, my MacBook Pro).
  2. A secure way to access your machine from anywhere (this is where Tailscale comes in – check out my deep dive into Tailscale if you haven’t already).
  3. A decent internet connection (don’t worry, it works better than you'd think on hotel WiFi).

Installation and Configuration

I was pleasantly surprised by how straightforward the setup process is. While I'll walk you through the basics here, I highly recommend following this comprehensive guide for the nitty-gritty details.

For reference, I personally set this up on an old MacBook Pro that I no longer use for anything else. Steps should be similiar for other Linux/MacOS machines, can't say for Windows but should be somewhat similar / easy!

Here are the core steps:

  1. Install code-server using Homebrew:
brew install code-server
  1. Set up code-server to run as a background service:
brew services start code-server

This ensures that VS Code Server will always be running and accessible on your development machine.

Celebrate this is great!

If you're having some issues on a Mac, I had to run a brew upgrade && brew cleanup to get it working.

  1. Public network access
  • This step can be a little tricky, we need a way to access the code server from anywhere.

  • There are numerous ways to do this, i.e., ngrok, cloudflare tunnel, localtunnel, etc. to make your local server accessible from the public internet.

  • I opted for Tailscale for this project as I already had it installed and I love how easy it is. Simply install it on both your iPad and MacBook, then configure your network to allow private access to your development environment.

Securing with HTTPS

The rest of these steps are going to be assuming you used Tailscale. You will need to take similar steps regardless of your method but the instructions will differ slightly.

While the basic setup works, I highly recommend securing it with HTTPS. Here's how:

  1. Install Caddy (our HTTPS proxy):
brew install caddy
  1. Set up HTTPS on Tailscale:
  1. Generate your certificate:
/Applications/Tailscale.app/Contents/MacOS/Tailscale cert <device-name>.<tailnetname>
  1. Configure Caddy:
# Find your Caddyfile location
brew services start caddy -v
# This will output the location of your Caddyfile
# in the "Program Arguments" field

# Create/edit your Caddyfile
sudo touch /opt/homebrew/etc/Caddyfile
sudo nano /opt/homebrew/etc/Caddyfile
  1. Add this to your Caddyfile:
<device-name>.<tailnetname>

reverse_proxy <tailent_device_ip>:8080
  1. Restart everything:
brew services restart caddy && brew services restart code-server

That's it! You can now access your VS Code Server securely via https://<device-name>.<tailnetname>. The connection is end-to-end encrypted and you'll get that satisfying little lock icon in your browser. 🔒

  • Notice if you run say a Django app on localhost:8000, VS Code Server will proxy that to the public internet as well!

NOTE: upon logging in, you'll need to get your password. This is set in your ~/.config/code-server/config.yaml file. You can change it to whatever you want.

Testing Your Setup

To make sure everything's working:

  1. Open Safari on your iPad
  2. Navigate to your secure URL
  3. Log in with your code-server password
  4. You should see your VS Code environment load up!

The iPad Development Experience

Let's talk about what it's actually like to code on an iPad because, honestly, it's probably better than you're imagining.

The touch interface works surprisingly well with VS Code, writing / Apple pencil a bit less so.

That said, if you're planning to do any serious coding, you'll want to pair it with a Magic Keyboard or similar. Once you do, the experience is actually pretty great, especially if you have a larger iPad like the 13 inch.

Performance-wise, I've been impressed. While you obviously need a reliable internet connection, I’ve successfully coded on coffee shop WiFi, hotel networks, internationally and even while tethering to my phone. There’s minimal lag, and while you might notice it occasionally, it’s rarely enough to impact your workflow.

What You Get

With this setup, you get:

  • Full access to your development filesystem (all your projects, right where you left them).
  • The ability to run local development servers and access them through proxied ports.
  • Support for most VS Code extensions (yes, including that one you can’t live without).
  • Terminal access for running git commands, builds, or whatever else you need.

Potential Improvements

  • Docker: I actually run my code-server within Docker as it's much easier to manage and replicate.
  • Cursor: I've been using Cursor as my primary IDE for a while now. I haven't been able to get it working with this setup yet but I'm sure it's possible.

TLDR

Overall:

  • Input: The touch interface works surprisingly well with VS Code, but a Magic Keyboard or similar is essential for serious coding
  • Performance: Minimal lag even on typical WiFi connections (coffee shops, hotels, mobile hotspots)
  • Limitations:
  • Some VS Code extensions might not work perfectly
  • Local debugging can be trickier
  • You'll need reliable internet access

Cursor Code Server?

A quick note for fellow Cursor IDE enthusiasts – I recently switched to using Cursor as my primary IDE and naturally wanted to get it working with this setup. Unfortunately, I haven’t had any luck so far.

While this isn’t a dealbreaker for me (since I’m mainly using the iPad setup for quick fixes and minor updates), it would be nice to have consistency across all my development environments.

I’ll update this section if I find a noteworthy solution.

Conclusion

After years of searching for a way to code effectively on an iPad (and finding mostly disappointing solutions), this setup has been a game-changer.

While it almost definitely will not replace your main development machine, it transforms the iPad from a consumption-only device into a real development tool.

Whether you’re looking for an emergency backup solution or trying to lighten your travel load, this setup is worth exploring. It’s reliable enough for real work while maintaining the iPad’s advantages of portability and battery life.

I'll say as well on a personal note - I really do enjoy the iPad just in itself as well. This is really just the cherry on top in my view.

For anyone who’s ever Googled "can I code on iPad" (I’ve been there more times than I’d like to admit), this is probably the solution you’ve been looking for. It’s not perfect, but it’s pretty darn close.

Comments

No comments available :/

Leave your thoughts! 💭


Tags

Self Hosting

Tailscale

Tips and Tricks

Say hi!