My home server setup: coding agents, dev servers, and more!

My home server setup: coding agents, dev servers, and more!
Photo by Adrian Maximiliano Arellano / Unsplash

Back in Feb, when OpenClaw had just come out, there was this craze around people buying Mac minis and setting them up as home servers for running AI agents doing all kinds of work.

I gave that a shot, with Hermes agent, but it did not fit my workflow, and my Mac mini gathered dust for a couple of months. (Tbh open ended agents like OpenClaw and Hermes still don't make a lot of sense to me, even 6+ months down the line)

Then, a few months later, necessity became the mother of invention when I bought a cute little MacBook Neo (because it was pink!) and needed to work around its very limited resources.

While my 16 inch MBP had started to feel big, bulky, serious, and "professional", the pink Neo felt whimsical, cute, and fun. It was also way more portable to use on the couch, on the beanbag, in bed, etc.

But, the Neo had 8GB of RAM and the same CPU as an iPhone with not a lot of storage. If I were to use this device to work, I had no option but to offload heavy work like AI agents and dev servers to a machine with more resources. Luckily, that machine was already plugged in, and begging to be used.

So, I got a bunch more gear, and set up my Mac mini with redundant internet connections, redundant power backups and my own private network between my devices. Compute clusters even make an appearance in the story! It's a setup I'm quite proud of, it's made me more productive no matter where in the world I am, and whatever device I'm using at the moment.

What my setup looks like now

All my coding agent sessions run on my Mac mini. I can start a session on my Neo, continue seamlessly on my iPhone while I'm on the road, and I don't need to keep a finger in between the laptop lid! I can even switch off the laptop I carry (Neo) and the agents keep on working. My dev servers (like nextjs and supabase) also run on the Mini, and they can be accessed by me from any of my devices by just going to a domain that maps to my Mac mini's Tailscale network IP.

I have agents running 24x7, and I've spent days, weeks, and months away from home while my home server stays online and accessible from anywhere in the world, with AI agents writing new code, running experiments, or automating boring work for me at the press of a button.

I am writing this on the Neo, and it's become my primary machine now. It's light, pink, cheap (will only cry a little if it breaks, and mainly due to the pink part), cute, and perfectly capable with a setup like this. Just skip Chrome. (As a bonus, my apps now work really well in Safari)

The hardware side

Let me walk through the hardware setup. The networking, power backup, storage.

Network

I have two fiber internet connections from two separate ISPs. Each ISP router has its own router UPS for backup that can keep it running for 4-6 hrs after power loss.

I do not connect to the ISP routers directly. I use a Deco mesh network with multiple routers spread around the house as I live in a crowded network zone with like 20 WiFi networks around me.

The primary internet router plugs into my main Deco via cable, and the main Deco runs cables to another Deco in my bedroom, my Mac mini, and a network switch in my living room.

The network switch splits one cable into three, for my TV, PS5, and MacBook Pro.

Tip: connect your server to the network over LAN, thank me later.

I did not start out with wired networking. WiFi is good enough, right?

Wrong.

When I started using my Mac mini over SSH and screen sharing, it used to lag a lot even when I was at home. I discovered that WiFi networks work like highway lanes. Mine had two lanes, one of which was being used by my Deco mesh setup for inter-node backhaul, which split the traffic carrying capacity in half.

I moved that Deco to a wired setup to get my two lanes back, but it still wasn't enough. With several laptops, phones, TV, PS5, tablets, and an array of smart home devices all competing for the same airspace, I'd get a 4ms ping most of the time but it would keep jumping up to 300ms frequently. It was a janky experience. Moving my Mac mini and all other ethernet capable fixed devices to a wired setup was a HUGE improvement. Stable pings without jitter, and faster uploads and downloads, and lower latency. Seriously, go wired.

As for how the two ISPs are set up, Deco has a built-in internet backup function which can detect when the main network goes out and switch over to a secondary network.

Several issues there that I had to find out the hard way.

  • One, the backup network must be wireless.
  • Two, the failover can take like 5 mins to kick in.
  • And three, that 5 mins is only true if it works at all.

I found out that it's unreliable when I was in a different city a thousand kilometres away and my primary network dropped and my Mini stayed out of reach for hours. When I get back home, I'm setting up a hardware solution for this. There are multi-WAN routers and I suggest you use those.

In the meantime, my Mini now detects internet disconnections using a polling script and switches to the secondary network when it happens, and back to primary when it recovers. This obviously only works on my Mini and my entire home network stays offline. A multi-WAN router nips this in the bud.

Power Backup

I am serious about power backup, with redundant backups for all critical infra.

Each router has its own router UPS with 4-6 hrs of power backup.

The Mac mini has its own UPS.

Inverters have a UPS mode. I have an inverter and it's supposed to switch on immediately during power loss, but, and I'm still trying to figure this out, it sometimes doesn't, and a few seconds is all it takes for my Mac mini to end up losing power and then rebooting, killing all my running work. Unacceptable.

My guess for why this is happening is my inverter is getting overloaded, perhaps due to my 3D printer. Regardless of the cause, the Mini gets redundant power backup, a dedicated UPS with somewhere in the range of 3 hrs of backup (that I thankfully haven't needed to test lol). Both the router UPS and the Mac mini UPS sit behind my inverter, so the UPSes mostly only kick in after both the power running out and the inverter battery dying.

My estimates give me about a 24 hr runtime of my whole setup on power backup alone.

The Mac mini

This is the brains of the setup.

The Mac mini has an SSD and an HDD connected to it, for Time Machine backups and additional storage. I also was able to upgrade the SSD from 512GB to 1TB which was a huge improvement. I've got 24GB of RAM. You can never have too much RAM.

This thing is tiny, quiet, and consumes so little power I wonder if a potato battery could power it. It's seriously efficient. It idles at under 5W. Although it doesn't really idle much for me ;)

The software side

If setting up the hardware side wasn't fun enough (it was a lot of fun!), the software side added a whole other level of fun on top! Seriously, I've loved to geek out on this setup and now I feel like Batman or something. I love giving people a tour of my setup, and they all agree I'm very cool 😛

Tailscale

I had heard about this tool a lot on Hacker News. All the cool people were apparently using it, but I couldn't figure out why. Until I ran into a problem.

I wanted to be able to connect to my Mac mini from anywhere. Locally, I could just connect to its 192 address, but that only works when I'm home. I needed a way to reach my Mac mini even when I wasn't at home. That means exposing it over the internet.

If you have a static public IP (home ISPs often refer to these as "dedicated IP", and when talking about home networks, so do I), you could just expose that. I did not have a dedicated IP. And I did not want to expose my server to the open internet.

This is where Tailscale comes in. It creates a network that your devices can connect to, where each device gets an IP address that never changes. These IPs can only be reached by people on your specific Tailscale network. A "virtual" private network.

All my devices – my laptops, the mini, my phones, all connect to my Tailscale network. My own little internet.

Caddy

My Tailscale IP looks like 100.120.69.94.

I do not want to type in 100.120.69.94:3000 every time I open my site. I want to type projectname.dev. I bought some .dev domains for my projects, and I pointed them to my mini's Tailscale IP (also called Tailnet IP) via Cloudflare.

Caddy is a web server. It sits in front of my projects' services (like NextJS, Supabase), and exposes them from localhost to my Tailscale network.

It maps localhost:3000 to app.projectname.dev, including automatically setting up SSL certificates (https://app.projectname.dev) using Let's Encrypt and Cloudflare. Your AI agent can help you set it up, it's pretty easy.

(cloudflare_dns_tls) {
	tls {
		dns cloudflare {env.CADDY_CLOUDFLARE_API_TOKEN}
	}
}

myproject.dev {
	import cloudflare_dns_tls
	reverse_proxy 127.0.0.1:3000
}

supabase.myproject.dev {
	import cloudflare_dns_tls
	reverse_proxy 127.0.0.1:54321
}

That, is the entirety of my Caddyfile. I save this file, type caddy, point my Cloudflare A record to my Tailscale IP, and it's done.

I expose subdomains on my domains for different things, like a supabase.projectname.dev or experiment.projectname.dev. My Claude Code knows how to add and expose new subdomains for new projects on its own.

tmux

I used, and still use, my coding agents primarily via their CLI versions. And coding involves a lot of terminal windows. When you're connecting to your server over SSH, you can run one command inside one SSH session. And if you close the tab, or lose your internet connection, the SSH session dies, and the command stops.

I don't know about you, but I am not typing ssh alara@100.120.69.94 17 times.

This set of problems is what tmux solves.

tmux is something called a "Terminal multiplexer". You SSH into your server once, connect to your tmux session, and you can have multiple "windows" (tabs) inside. When you start a tmux session, it keeps running on the server even when you disconnect, including all the tabs inside it. You can reconnect to the tmux session from any device, and even multiple devices at once.

If you want to get the best possible tmux experience, use it with iTerm. iTerm has this integration with tmux called control mode, where tabs inside your tmux session become actual tabs in your terminal window. It's a quality of life improvement, but I hate tmux without it.

I created this function in my .zshrc file.

mini() {
  while true; do
    ssh -t 100.120.69.94 'tmux -CC new -As claude' && break
    echo "Connection lost — reconnecting in 2s (Ctrl-C to stop)..."
    sleep 2
  done
}

So I just type mini in my iTerm, and my tmux session opens up.

tmux is ancient (19 years). There are other newer terminal multiplexers, like herdr, that can come with some features specific to AI coding workflows, and their own client apps (herdr has one that came out recently). Feel free to experiment.

Cross device file sharing

A problem I ran into was that I would drag and drop files from my Neo, and they wouldn't be on my Mini so the agent couldn't find them. My username on each device is different, so I just told Claude Code to scp the file over to the mini if it has a certain username in the path. Pretty sure this could be further improved using Claude Code hooks.

mutagen file sync

The above works well for sharing individual files, but I wanted to have my full repo, with all my code, always stay in sync across my Neo and mini.

I wanted any changes I make on one showing up on the other.

If I couldn't reach my Mac mini, I wanted to be able to work directly on the Neo. And I wanted to edit files on the Neo with any tool, without mucking around with network drives and whatnot, and have those changes show up on the Mac mini immediately.

Dropbox is slow, goes over the internet, and can be unreliable.

This is where mutagen comes in. It's a tool that does bidirectional, real-time file and folder sync across devices over SSH, seamlessly in the background.

I had problems with the .git folder, but otherwise I've been very happy with it.

mosh and Moshi

mosh is a version of ssh optimised for mobile networks. It survives connection drops and switches. If you've seen the infamous Broken pipe error on ssh, mosh doesn't have that problem. I tried to use mosh with iTerm and tmux, but I ran into some issues. I'm still trying to figure out an alternative because I love my tmux control mode, and I don't want my tabs to disappear when I close my lid. I can reconnect with one command but it's annoying.

For my iPhone, I use this app called Moshi, which is a mosh client with built-in integrations for Claude Code, Codex, etc. It has a Whisper integration so I can speak out long messages. And it automatically uploads files from my phone to the server when I send one to an agent session.

Moshi doesn't have the tabs like iTerm control mode, so you need to swipe from window to window, which can feel a little annoying when I have 20 tabs open and need to swipe 7 times to find the right one. Once I've found the right tab, it's good and has coding specific integrations similar to herdr.

mprocs

I did not want to run next dev, caddy, npm run trigger:dev and whatever else manually each time I started working on my project. I set up an mprocs.yaml and now I just type mprocs and all my regular servers start running in one go.

Using the MBP as a Compute Node

My Mac mini has 24GB of RAM. I started running into its limits quite quickly.

Running 32 Claude Code sessions, 3 Codex sessions, various Node servers, etc. will do that. Although, I mean, I'm sure that if you gave me 128GB of RAM, I could find some way to make even that seem like "too little". Maybe that's just me lol 🤷🏻‍♀️.

But yeah, I was running into issues due to too little RAM, and I had my MacBook Pro from before, with 32GB of RAM, just gathering dust(!!). Why not build a cluster, right? It's something I've always wanted to do, and it's crazy how easy it was to get this set up with Claude Code.

I set up a system that lets my Mac mini run my dev servers on the MacBook Pro. An SSH tunnel between the two forwards requests from the Mini to the MBP, so it all happens transparently to me. If the MBP disappears, the Mini self-heals by restarting the process on itself instead.

So my 24GB of RAM became 56GB.

exo - running LLMs

I also tried to use this tool called exo to run LLMs too big for one device by combining multiple devices' storage and vRAM, but it always either gobbled up all my system resources, was too slow, or forced me to use a model too stupid for any real work.

They have some thunderbolt bridge thing in new versions that they claim solves a lot of the speed problem, but my hardware does not support it, so I scrapped this project.

Conclusion

My setup has evolved a lot over the months, and it keeps evolving as I run into new problems and annoyances, or come across better tools.

Combined with always-on AI agents, it's enabled a whole new level of productivity for me. My Mac mini is reliable, with redundant power and internet, and it's in my control, in my own home. Since it never sleeps, agents can work on it 24x7. I've built enough guardrails into my Claude Code setup that I'm comfortable letting it merge and deploy PRs with zero input from me, even while I'm asleep.

I've woken up to new builds of my iOS app on TestFlight, bug fixes pushed to the Chrome Web Store, and new features added to my apps. Literally hitting the ground running, without lifting a finger.

Being able to do this at any time, from any device, with multiple things running in parallel, has been a crazy leap from the single Claude sessions I used to run on my MacBook Pro. The difference is huge, and completely worth the occasional rabbit hole.

What started as a fun experiment during a hype cycle has become just the way I work now.