How I built a self-hosted homelab with local AI agents
How it all started
I bought a NAS to store files. That was the whole plan. Seriously.
Then I thought “wouldn’t it be cool if it also ran my media server?” Then monitoring. Then a reverse proxy. Then AI agents. And… well, here we are. A full infrastructure project that I never planned but I’m honestly quite proud of.
If you’ve ever fallen down the homelab rabbit hole, you know exactly what I mean. If you haven’t, consider this your warning.
Two machines, zero cloud bills
The whole setup runs on two boxes sitting on my desk.
A UGREEN DXP2800 NAS that handles storage, media automation (the whole Sonarr/Radarr stack), monitoring with Prometheus and Grafana, and reverse proxy. At this point it does way more than storing files, to be honest.
And a Mac Mini as the brain. It runs Ollama natively on Apple Silicon, so I get GPU-accelerated LLM inference without paying a single API call. OpenClaw on top orchestrates AI agents, and Open WebUI gives me a ChatGPT-like interface to local models. All of this. On a box the size of a sandwich.
┌─────────────────────────────────────────────────────────┐
│ ☁️ Cloud Azure OpenAI · GitHub Actions · CF │
├─────────────────────────────────────────────────────────┤
│ 🖥 Mac Mini Ollama · OpenClaw · Open WebUI │
│ 📦 NAS Prometheus · Grafana · Jellyfin │
│ 🤖 Telegram Bot 4 AI agents · multi-topic routing │
└─────────────────────────────────────────────────────────┘
AI agents that actually do things
OK so this is where it gets fun. I have a private Telegram group with topic channels, and each one is wired to a different AI agent through OpenClaw:
| Agent | Channel | What it does |
|---|---|---|
main | #assistant | My personal AI. Answers questions, brainstorms ideas, thinks out loud with me |
monitor | #monitoring | Gets Prometheus alerts via n8n. No AI reply, just logs and notifications |
media | #media | ”Add The Bear season 4” and done, it talks to Jellyseerr |
devops | #devops | Container health checks, Docker troubleshooting |
Everything runs on local Llama models. No data leaves my network. When I need something heavier (complex code analysis, for example), I switch to Azure OpenAI with /model azure/gpt-4o and come back when I’m done. Best of both worlds.
Monitoring everything
Because I sleep better that way.
Prometheus scrapes every container and endpoint. Grafana makes it pretty. Alert rules catch disk pressure, container crashes, and memory issues before I even notice.
Uptime Kuma adds HTTP health checks on top. If Jellyfin goes down at 3am, my phone buzzes. I won’t fix it at 3am, let’s be real, but at least I know.
The media stack
Also known as “the reason my family puts up with the NAS.”
Sonarr, Radarr, Prowlarr, Bazarr, Jellyfin, Jellyseerr. Everyone at home can request movies and series from their phones without knowing any of this infrastructure exists behind it.
When it works (and it usually does), nobody notices. When something breaks, everyone notices. Immediately.
Things that bit me along the way
Every homelab has its “I just spent 4 hours debugging this” stories. Here are mine, in case they save someone else some time.
UGOS Pro blocks port 53 on 0.0.0.0. I couldn’t figure out why AdGuard Home wouldn’t start. Turns out the OS reserves that port. You need to bind to the specific interface IP. Took me way longer than I’d like to admit to find that.
OrbStack ≠ Docker Desktop. On the Mac Mini, host.docker.internal doesn’t resolve reliably. The fix? Just use the actual LAN IP in your env vars. Simple, but not obvious when you’re deep in Docker networking at midnight.
Docker images with hardcoded UIDs on UGOS Pro. The SSH user can’t chown Docker volumes because the daemon runs as root but you don’t. Workaround: run chown inside a throwaway Alpine container. Not pretty, but it works.
Local LLMs are better than I expected. For infra tasks (summarizing logs, answering Docker questions, drafting alerts) a 7B model on Apple Silicon is faster than any API roundtrip. I really expected to depend on Azure OpenAI a lot more than I actually do.
What’s coming next
Next on the list: Cloudflare Tunnel so I can reach everything from outside without touching a single port. After that, I want to wire up AI brand agents where I send a Telegram message like “write something about this cool article” and get back a blog draft plus a LinkedIn post, ready to review. And somewhere in there, wildcard HTTPS with automated cert renewal via Cloudflare DNS challenge so I stop dealing with certs manually.
The homelab is never finished. But that’s honestly the best part about it.
If any of this helps someone take their next step into self-hosting or local AI, it was worth writing 💙
Built with curiosity. Shipped with docker compose up -d.