My home server? My laptop

A couple of years back, I began experimenting with self-hosting. I dug out an old laptop and set it up as an always on home server. It did many jobs. Stuff like acting as a file server with access to external storage and backups, automating tasks with scripts, music server, running a torrent client for my legally acquired content and more.

It worked fine. But, the added complexity of another machine bugged me slightly. Most of the tasks could be solved on my daily driver laptop. There was also the fact that it didn't run the latest software from Apple. This caused a lot of friction. I couldn't run Homebrew. It caused a lot of issues when trying to install or update packages. Most current programs would not run on my ancient version of MacOS.

These issues made me want to shut down this "server" and simplify my setup. To do so, I had to solve two problems:

  • Storage space: My original motivation for setting up the home server was convenient access to more storage space. My laptop only has a 256GB drive. A 1TB external SSD solved the issue, but I move around the house a bit with my laptop, so it was rarely connected. Which meant the data on the external drive was rarely available.
  • Remote access: After moving away from Spotify, being able to access my music collection from my phone on the go was convenient. My home server also ran my static site generator, meaning I could update this website on the go with my phone, if I wanted. (Happened like two times, one of which was me testing that it worked. Still, just in case, you know.)

I've solved both problems and decommissioned my old home server. The light bulb moment? Realising that my "home server" doesn't need to be a separate machine. My regular, daily driver laptop can do the job! A server is, after all, just a computer that's always on. My regular laptop can do that, too.

Let's dive into each of the specific problems mentioned above.

Storage space

As mentioned, my laptop doesn't have enough space for all my data. Using cloud storage and an external drive for local backups, I've been able to work around this limitation.

The past year I've been using a remote installation of Nextcloud for cloud storage, and much more. With the aim of simplifying my setup, I wanted a solution that required less maintenance. After considering multiple solutions, I landed on going back to Apple's iCloud.

Both my laptop and phone are Apple devices. iCloud services are neatly integrated. And, having migrated away from iCloud recently, I feel like I have a solid grasp of what my setup should look like to minimise dependency and vendor lock-in.1 After shopping around, I also realise that the 2TB storage tier is actually reasonably priced. Lastly, it let me go back to using iCloud Photos to browse my photos and videos. It works well and I like it.

I don't want to rely solely on a third party and "the cloud" to preserve all of my data. Especially precious photos and videos. To solve this, I've landed on the following routine:

At the beginning of each month, I export all of my photos and videos from the previous month from Photos to my external drive.2 I then export every other file and document stored on my cloud drive to the drive.

Is it bullet proof? No. I'm susceptible to losing as much as a month's worth of data with this approach. In contrast to a total wipe out, something I can live with.3

Remote access

Above I mentioned two specific cases of remote access that I had come to rely on:

  1. Music collection.
  2. Updating my website.

By setting up my laptop as a de facto server, I've solved both.

Accessing my music collection on the go

I iterated through several approaches for making my music collection available remotely. I first tried Doppler and their sync to iOS feature. While I think Doppler is hands down the best app for playing music on both Mac and iPhone,4 I found the sync cumbersome.

Next, I thought of using iCloud Drive as a "music server". Surely some app could watch a folder in my iCloud Drive and automatically add new files to my music library? Well, you'd think so. But no. I couldn't find any decent app(s) that solved this to my expectations. Plus, my phone doesn't really have enough storage to save my full music library locally. Which really only left me with one option: Setting a full-fledged music server.

This was the solution I had been using for the last few months, running Nextcloud Music on my Nextcloud instance. I resigned myself to the fact that I needed a remote virtual server to solve this. As I'd been wanting to test out Pikapods, I decided to try out Airsonic Advanced. It was too advanced (I have no right to be surprised) and I couldn't get it set up exactly to my liking. Instead, I switched to Navidrome and I found it an absolute delight. I couldn't believe how fast and lightweight it was!

It worked well and, as a bonus, I could continue using Amperfy which I had become comfortable with these last few months. One thing was still bothering me: Streaming and caching my music collection from a remote server, when it was already stored in full on my Mac, was incredibly wasteful. Realising I was (again) on the lookout for a music player to play music on my Mac left me feeling like I was back to square one. Eventually, though, the penny finally dropped:

"Navidrome is so lightweight, I could probably run it on my laptop without any issues!"

Using Homebrew, setting up Navidrome on my laptop was a five minute job. Configuring my laptop to automatically launch Navidrome on startup took me another five minutes. Now we're (rocking and) rolling! The native Navidrome web interface is perfect for playing music on my laptop. And all I had to do to access my music collection from Amperfy on my phone was change the server URL and authentication details.

I didn't really mind only being able to access my full library while on my home network. Amperfy has great caching and downloading the albums I want is no hassle. The only inconvenience was keeping my laptop open and awake to access my music.

Luckily, the other penny dropped at this point. This is a solved problem! I already set up a Macbook as a "home server" and there's no reason I can't do it with this particular Macbook. So, I ran the terminal command5 and I was off to the races. Despite decommissioning my home server, I once more had a "server" running at home. Just one that doubles as my daily driver laptop.

Remotely updating my website

With my laptop running as a server, this problem was solved as well. It was simply a matter of updating my old workflows to rely on iCloud Drive instead of my old Nextcloud instance.

Because I'm not the smartest guy around, my site generator is quite simple: A script monitors a "content" directory. When a new file appears, the site generator runs to process this file and upload all the new and modified files to the server that hosts my website. This lets me update my website from anywhere without having to worry about remote access to my home server. All I have to do is save a text file to the content directory. Whichever cloud service I'm using then does the sync magic, and my home server a.k.a. my laptop, updates my website.

Even images exist only as a file in my content directory. If I reference them in a text document, the site generator picks them up and uploads the file(s).

And that's it. I can now create posts and notes from my phone while I'm on the go. I don't know that I ever will, but at least I can rest comfortably knowing that I can. And that's the most important thing.

TL;DR

I tweaked a setting on my laptop to make sure it doesn't go to sleep when power is connected. I connect to it with my phone to listen to my music and update my website when I'm on the go.

Postscript

You didn't think I'd actually settle on not being able to access my full music collection while on the go, did you? About five minutes after thinking I could live with that, I remembered Tailscale. With my "server" running a current version of MacOS, I could actually install it and rely on it for proper remote access.


  1. That topic probably deserves its own post. The short version is: Make sure that you control your own data, and that it is stored in open file formats. Picking up your files and going elsewhere is always easier than trying to export data from a proprietary storage solution. 

  2. Photos and videos is a great example of where you should make sure that you have your data stored as actual files on a disk. 

  3. I always imagine that somehow a "delete all" command will hit my cloud data. Because of syncing, it also wipes out my local copies. That's why I want complete separation for my backups. In that sense, a disconnected external drive makes perfect sense. 

  4. Doppler's refund policy also deserves a shoutout. I bought the Mac version and tried it for a couple of days. When I found it wasn't for me, I sent them an email and requested a refund. My money was promptly refunded, no questions asked. This experience made me want to purchase more software from Brushed Type. 

  5. sudo pmset -b sleep 0; sudo pmset -b disablesleep 1 disables sleep on a Macbook while connected to power, even when you close the lid.