Like a lot of people, I got tired of two things: paying monthly for AI tools, and not knowing where my data ends up. So I built a small, self-hosted "AI home lab" that runs entirely on my own machine β and packaged it so anyone can deploy it in about 5 minutes.
Here's what's in it and how it fits together.
The stack
Three independent Docker Compose stacks, each solving one problem:
π€ Private AI (Ollama + Open WebUI)
A ChatGPT-style web interface that runs 100% offline. Ollama is the model engine; Open WebUI is the chat frontend. You pull a model (llama3.2, mistral, qwen2.5β¦) and chat privately β nothing leaves your box.
services:
ollama:
image: ollama/ollama:latest
volumes:
- ollama-data:/root/.ollama
open-webui:
image: ghcr.io/open-webui/open-webui:main
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
The two services talk over an internal Docker network β only the web UI is exposed.
π Monitoring (Netdata)
Zero-config, per-second dashboards for CPU, RAM, disk, network, and every container. You literally just start it and open the dashboard.
πΎ Backups (restic)
Scheduled, encrypted, deduplicated backups of your Docker volumes. Set a password and a cron schedule and forget it.
Lessons learned building it
- Network isolation matters. Each stack gets its own bridge network; only user-facing ports are published. Ollama should never be exposed directly.
-
Resource limits are not optional. Without
deploy.resourceslimits, a big model can starve the host. Every service got bothlimitsandreservations. - Encryption passwords are a footgun. restic encrypts with a password β lose it and the backups are gone. Document that loudly.
- Test before shipping. I deployed every stack and verified the health endpoints before calling it done.
Hardware reality check
- 8 GB RAM runs small models (llama3.2) comfortably on CPU.
- 16 GB+ or a GPU unlocks the bigger, smarter models.
- No GPU required β it just runs slower for large models.
Get it
I cleaned this up, documented every stack with step-by-step guides + troubleshooting, and put it up as a downloadable pack for anyone who'd rather not assemble it from scratch:
π https://symshah.gumroad.com/l/selfhosted-ai-homelab
Happy to answer questions about the setup in the comments β always keen to hear how others structure their homelab AI.
Top comments (0)