Replacing my soup-damaged MacBook with an iPad + a Raspberry Pi

Sean Chok
5 min readSep 17, 2021

--

I’ve actively been programming web applications using a MacBook Pro that was bought in late 2019. Working on it is a genuine joy because it is so easy to install and use many of the developer tools software engineers need. Most of the time, I just have to do `brew install`.

But not all things go well all the time.

https://www.shutterstock.com/image-photo/spill-coffee-on-computer-keyboard-1252729444

My habit of eating and watching a show at the same time has finally bit me, and it bit hard.

My MacBook is gone for the time being. But I still need to work. Is it possible to setup something without breaking the bank?

While the repair specialist “has taken possession” of my MacBook, I need a replacement workstation. A Raspberry Pi 4 that’s just collecting dust opened an interesting approach that I always wanted to try. And to me, using Windows is an absolute no-go.

As a university student, I regularly use an iPad to view class lectures, and take notes. Since the soup accident happened, I was thinking of combining the iPad with the Raspberry Pi to create some kind of Linux work environment that is essentially mobile, and accessible anywhere on campus.

These are the ingredients to make this work:

  • An iPad (connected to a physical keyboard preferably)
  • A Raspberry Pi model 4 (quad core ARM cpu, 8gb ram)
  • SSH
High level idea for implementation

Here are 2 things to note:

  • The network the Raspberry Pi is connected to belongs to the university. And it doesn’t allow external access to devices that open their network ports. In other words, the network functions like a VPC. That means only other devices connected to the same network can access those devices. This adds a layer of security through the network layer the Raspberry Pi is going to be on.
  • Only I know the password to the ssh login sessions.

Step 1

Install Ubuntu, alongside several useful apt packages on the Raspberry Pi.

Step 1.1

Install software tools like docker, python and nodeJS.

Some of the installation guides I used are:

Step 1.2

Install code-server to run a VS Code-like server that is hosted on a port.

The port traffic can be tunneled through ssh later, so that it becomes available on Safari on the iPad.

If you’re trying this out as well, I highly recommend you to checkout their setup guide for the environment you’re using.

Step 1.3

Get the IP hostname of the Raspberry Pi.

There are a few ways to do it on the terminal. But the easiest one I’ve found is `hostname -I`. Then I copied the output, and put it aside.

Step 2

Install an ssh client on the iPad.

I’ve chosen Termius that comes with a 14-day free trial. It has excellent functionality and a great UI.

Step 2.1

Add configs for a host machine (Raspberry Pi).

Using the IP hostname I got earlier, I created a configuration like so.

Setting up a new host

Step 3

Connect to the remote host (Raspberry Pi).

Termius has made it really intuitive to just connect to the host, and create an ssh login session. Essentially a terminal pops up, and I could start working.

Step 3.1

Forward ports from the remote host (Raspberry Pi) to localhost (iPad).

My work revolves around frontend and backend development. That means ports like 3000 and 4000 are used to inspect what my code is doing. SSH is able to tunnel port traffic from a remote to a local machine, and that’s what I have made full advantage of.

Termius has that port forwarding functionality built-in, so all I had to do, once again, was to put in some configurations.

For example, a nextJS server running on port 3000 on the Raspberry Pi can be accessed like so.

Configuring local port forwarding

Take Away

Over the last few days of working with this setup, I can say that the experience isn’t too bad.

An iPad + a Raspberry Pi manages to achieve 80–90% of what I used to be able to do on a MacBook.

I realized that this is possible because most software can run on web browsers.

Splitting the screen with terminal and safari

Not everything is available. For example, Safari on iPad doesn’t really do inspection mode, and this can be a bottleneck for frontend development, especially while trying to debug errors.

Another potential problem is that some things just don’t support ARM64 which is what the Raspberry Pi is built on. In these cases, that ever so happen occasionally, I would switch to alternative software vendors, or build from source. Building from source isn’t as intimidating as most people think; it only requires a bit more patience to read and follow instructions.

Maybe there are some hiccups here and there. However, I’m just glad that the idea has been successfully validated.

I’ll probably be working like this until either my MacBook gets fixed, or I just get a new MacBook (with the M1X / M2 chip though 😎).

Thanks for reading.

P.S. this article was written on the same iPad.

--

--