top of page

The Mac mini in the cupboard

11 minutes ago
6 min read

If you've been following the blog, you'll know that over the last few months I've been building a lot of apps with Claude, our iPhone apps Pantry and Recipe Box, plus a whole collection of Homey apps for the smart home. All of that work has been happening on my MacBook Air, and the poor thing has been working flat out!


So this week we made a change. The Mac mini that's been sat on my desk has moved into the hallway cupboard, alongside the Homey, the NAS and the rest of the smart home kit. It now runs without a screen, keyboard or mouse, completely on its own, and it's become the place where all of our projects live and all the building happens.


A Mac mini, Synology NAS and small network rack on a white shelf in a hallway cupboard
Its new home in the hallway cupboard, sat next to the NAS and the network rack

Why not just buy a bigger, better Mac? Believe me, I looked! I spent a good while weighing up a new MacBook against a new Mac mini, but every option with the storage I wanted came with a price tag that was hard to justify. The Mac mini I already had is an M4 with 16GB of memory, more than capable of the job, so in the end the most cost effective answer was to make better use of what we've got. That left the money for something I really did need, a dedicated iPhone for developing and testing our apps on.


There was one catch though, and it's one a lot of you will recognise. Both Macs only have 256GB of storage. That sounds like plenty until you start building apps, because Apple's developer tools (Xcode) and the pretend iPhones it uses for testing (the simulators) can easily swallow 40 to 60GB between them, and that's before you add the projects themselves and all the files that get created every time you build an app.


My MacBook had been creeping towards full for weeks, and moving everything onto a Mac mini with exactly the same size drive would only have moved the problem from one desk to another?


Apple do offer bigger drives, but only when you buy the Mac, and the upgrade costs a small fortune. You can't just pop a bigger one in later like you can on most PCs.


The answer was a lot simpler, and cheaper. The Mac mini has Thunderbolt ports on the back, which are fast enough to run an external drive almost as quickly as the one built in. So we bought a small aluminium case (an enclosure) and a 1TB drive to go inside it, and plugged it into the back of the Mac mini, where it'll stay.


I did think about using one of the drives I've pulled out of old laptops over the years, I've a little pile of them waiting for eBay. One came out of a Dell laptop and was a good drive, but it's 2021 vintage and I had no idea how hard its previous life had been. For something that's going to be working away every day, I wanted peace of mind, so I bought new, and with Black Friday on, the price was right.


The drive, the enclosure and a little plug that tricks the Mac mini into thinking it has a screen attached (more on that in the technical bit) came to £238.32. Compare that with the cost of a new Mac and it's a bit of a no-brainer!


All of our projects now live on that drive, Xcode keeps its building files there too, and the Mac mini's own 256GB is left for macOS and the apps. Once everything was safely moved across, I cleared Xcode and the old projects off the MacBook, and it now has 131GB free 😁


So how does it work day to day? The MacBook has become the remote control. I still sit at it and ask Claude to build or fix something, but the work itself is done by Claude running on the Mac mini in the cupboard. If I close the MacBook lid, the Mac mini just carries on, and when I come back the job is either finished or waiting for me.


When I need to actually see the Mac mini's screen, say to check an app in the pretend iPhone, I use the screen sharing that's built into every Mac, and it fills my MacBook's screen as if I was sat in front of the Mac mini itself. And because it's on our private network (more on that below), it works whether I'm at home or out on a job.


The other thing that had been driving me mad was Claude losing track of things. A decision made in one chat would be nowhere to be seen in the next, and I'd find myself explaining the same project over and over. So now every project has its own notes file sat right next to the code, covering what the app is, how it's built, where it's up to and the decisions we've made along the way. Whichever Claude opens the project reads it first, so it already knows what's going on. Simple, but it's made a huge difference.


Of course, putting everything in one place is only a good idea if that place is backed up, and as always, that's the bit I'm fussy about. Every project is now saved in three places: on the drive in the cupboard, on our NAS through Time Machine every hour, and in private online storage on GitHub, which also keeps a full history of every change.


It's secure too. The Mac mini's own drive is encrypted, and so is the new one, so if anyone ever walked off with them, they'd get nothing. Getting to it from outside the house goes through a private, encrypted network that only our own devices can join, so there's nothing open to the internet.


The only downside? After a power cut, the encryption means the Mac mini waits for me to unlock it before it does anything. That takes about a minute from the MacBook, and I'll happily take that for the peace of mind.


So the Mac mini has gone from sitting on the desk doing very little to being the hardest working computer in the house, and all for a couple of hundred pounds. Now I just need to stop thinking up new apps for it to build… only time will tell?


If you're running out of space on your Mac, or have an old one sat doing nothing, get in touch, we're always happy to help.


The technical bit


For those who like the detail, here's exactly how it's put together.


The hardware

  • Build machine: Mac mini M4, 16GB memory, 256GB, headless in the hallway cupboard on Ethernet (already owned)

  • Remote: MacBook Air M4, 16GB, 256GB (already owned)

  • Drive: WD Black SN7100 1TB NVMe (TLC, 600TB written endurance, 5 year warranty), £175.95

  • Enclosure: UGREEN 40Gbps USB4/Thunderbolt NVMe enclosure, fanless, up to 3,848MB/s, £56.49

  • Dummy plug: 4K HDMI headless display emulator, £5.88


The enclosure is the speed limit, not the drive. Any decent PCIe 4.0 drive is faster than 40Gbps, so we chose on endurance and warranty, and the SN7100 runs cooler than the PCIe 5.0 drive we also looked at.


The network

  • Everything runs over our UniFi network, with a 5Gb link between the lounge and the cupboard and a 1.6Gb internet connection. The Mac mini is wired by Ethernet in the cupboard alongside the NAS, and the MacBook Air is on Wi-Fi.

  • Away from home, Tailscale links the MacBook Air back to the Mac mini without opening any ports on the router.


Running headless

  • sudo pmset -a autorestart 1 sleep 0 disksleep 0 womp 1, so it never sleeps and comes back after a power cut.

  • Screen Sharing and Remote Login (SSH) on, limited to my user, with SSH key login from the MacBook and Full Disk Access for remote users.

  • The dummy plug gives macOS a proper display, and Screen Sharing in High Performance mode with Dynamic Resolution sizes the Mac mini's screen to the MacBook's window.

  • FileVault stays on. After an unexpected restart, the disk is unlocked over SSH, then I log in through Screen Sharing. Planned restarts use sudo fdesetup authrestart, which comes straight back to the desktop.

  • Tailscale runs as a system service through Homebrew (sudo brew services start tailscale), not the App Store app, so it's up even at the login window.


Storage

  • The drive is formatted APFS (Encrypted), with the password in the keychain so it unlocks at login.

  • Projects live on /Volumes/Work/Developer, with ~/Developer linked to it so every path stays the same.

  • Xcode's Derived Data points at /Volumes/Work/DerivedData.


Claude

  • Claude Code runs on the Mac mini. From the MacBook I either use the Claude app's Code tab with an SSH environment pointed at the Mac mini, or type cc pantry in Terminal, a small shortcut that connects over SSH and opens the project in a tmux session that keeps running if the connection drops.

  • Every project has a CLAUDE.md with what it is, how to build it, its status and key decisions, and every project is in its own private GitHub repo.


Backups

  • Time Machine backs up hourly to the Synology over SMB, using its own DSM user with a 400GB quota so it can't crowd out the two MacBooks' backups.

  • Excluded, because they can be downloaded or rebuilt: Xcode.app, ~/Library/Developer (simulators and caches) and the Derived Data folder. The Work drive itself is included, which Time Machine doesn't do by default for external drives.


How it all connects


Diagram of the setup: a MacBook Air connects over SSH and Screen Sharing to a headless Mac mini in the hallway cupboard, which uses a 1TB Thunderbolt drive, backs up to a Synology NAS and pushes code to GitHub
How it all connects… the Mac mini does the work, the MacBook just tells it what to do

Everything is built on the Mac mini. The MacBook only connects to it, the drive holds the projects, and the backups go to the NAS and GitHub.

Comments


bottom of page