Code Anywhere: Using VS Code on Your iPad with a Raspberry Pi

Introduction
Hey there! There I was, lugging my hefty gaming laptop to the café every day, feeling the strain in my back with each step. It was like carrying around my own little tech boulder, just to do some coding with my favorite, VS Code. But then, something changed. I stumbled upon this cool thing called VS Code Tunnel, and suddenly, my coding life took a turn for the better. Now, all I need is my lightweight iPad, and I’m all set to code from anywhere, pain-free. Let me tell you how this game-changer works and how it turned my iPad into my new coding buddy.
Why Mix Raspberry Pi with iPad for Coding
- When I decided to switch to my iPad, I needed a small, cheap server for VS Code Tunneling. That’s where my Raspberry Pi came in. It’s tiny, doesn’t cost much, and uses very little power. Plus, it’s secure, so I don’t have to worry about my code.
- Setting it up was easy, and there’s a big community around Raspberry Pi to help out if you get stuck. Now, with my Raspberry Pi running, I’m all set to code at the café with just my iPad.
Step-by-Step Guide
Here’s how I got everything up and running with my Raspberry Pi and iPad:
- OS Installation: First off, I installed the latest OS on my Raspberry Pi using the Raspberry Pi Imager. This tool is super user-friendly and gets your Pi ready with the OS it needs. One important step is to set up your WiFi details in the Imager. This way, your Pi automatically connects to the internet without any extra hassle.

- VS Code CLI: Next, I downloaded the VS Code Command Line Interface (CLI) and
scp
it onto my Raspberry Pi. Since I have a Raspberry Pi 5, I made sure to get the version that works with ARM x64 architecture to ensure compatibility.


- Unzip the file
tar -xf vscode_cli_alpine_arm64_cli.tar.gz
- Running the Tunnel: With the CLI installed, I ran the VS Code Tunnel command
./code tunnel
. This creates a secure connection that lets you access VS Code from anywhere.

- Logging In: After running the tunnel command, I logged into my account. Following the setup process, a URL appeared in the terminal.
- Accessing VS Code on iPad: I took the URL from the Raspberry Pi and entered it into Safari on my iPad. After logging into my account there, I was greeted by the familiar interface of VS Code, right on my iPad.

And just like that, I was ready to code on my iPad, I can use VS Code and the Terminal.
VS Code as an app in your iPad
To add it to your home screen directly from the web app in Safari, follow these simple steps:
- Access the Share Menu: While on the page in Safari, tap the ‘Share’ icon located in the toolbar.
- Choose ‘Add to Home Screen’: From the share menu options, select ‘Add to Home Screen’.
- Name Your Shortcut: You will be prompted to name your shortcut. You can keep the default name or enter a new one.
- Confirm Addition: Tap ‘Add’ to finalize. The VSCode icon will appear on your home screen, ready for quick access.
Keep my tunnel running
You have a few options:
- Use the service command to run as a service. You can run
./code tunnel service install
then to ensure the service stays running after you disconnect runsudo loginctl enable-linger $USER
. - Use the
no-sleep
option,./code tunnel --no-sleep
, to prevent your remote machine from going to sleep.
To log run the command ./code tunnel service log
.
Useful Links