The operational half nobody writes about: watchdogs, memory tuning, browser reapers and the real free-tier limits — measured on a system that is actually running non-stop.
Every "run your own AI agent" guide stops at "it works on my laptop." The hard part starts after: the agent dies at 3 AM, a bot token returns conflicts, memory fills until the OOM killer picks a victim, and the free tier refuses to scale. This project documents what actually breaks on a small box — and ships the scripts that keep it alive.
RAM, swap, disk and load checks. Silent when healthy, loud when broken, with a per-alert cooldown.
Reclaims leaked browser trees — but only when no live client is attached. Dry-run by default.
Idempotent zram setup: 50% of RAM with zstd at priority 100. Pressure insurance without disk thrash.
One token per agent, webhook vs polling, 409 diagnostics, health checks for chat bridges.
Backups you never restore are not backups. Weekly verification into a scratch path.
Shell syntax, shellcheck, Python compile and a docs-link gate run on every push.
git clone https://github.com/Amz34/selfhosted-agent-stack.git
cd selfhosted-agent-stack
sudo bash scripts/zram_setup.sh 6144 # compressed swap
bash scripts/resource_watchdog.sh # silent unless unhealthy
bash scripts/chrome_reaper.sh --dry-run # reclaim leaked browsers
| Item | Free allowance | Used |
|---|---|---|
| Compute | 1× ARM instance, 2 OCPU / 12 GB | 1 instance, 24/7 |
| Boot volume | 200 GB total | at ceiling |
| Outbound transfer | 10 TB / month | a few GB |
| Monthly bill | — | $0–5 (model API only) |