ProDG Studios Mainframe — Orchestration Infrastructure Plan
Date: 2026-04-25
Version: 1.0
Target: Transform this VPS into a hardened central orchestrator for multi-agent workloads, services, and databases over a Tailscale mesh.
1. Executive Summary
This Ubuntu 24.04 VPS is currently running a near-idle Hermes Agent gateway with minimal surrounding infrastructure. The goal is to evolve it into ProDG Studios Mainframe: a resilient control plane that hosts the Hermes orchestrator, persistent databases, an internal service mesh via Headscale/Tailscale, containerized workloads, and observability — all reachable securely by downstream agents and team members.
Philosophy: Infrastructure as cattle, agents as services, network as mesh.
2. Current State Assessment
2.1 Hardware & OS
| Resource | Value |
|---|---|
| OS | Ubuntu 24.04.3 LTS (Noble) |
| Kernel | 6.8.0-100-generic |
| CPU | AMD Ryzen 5 3600 (6c/12t) @ ~4.2 GHz boost |
| RAM | 62 GB (utilization: ~2%) |
| Storage | 2 × 476 GB NVMe (RAID1) → 436 GB usable (utilization: ~2%) |
| Load avg | 0.13 (essentially idle) |
2.2 Network
| Property | Value |
|---|---|
| Public IPv4 | 65.109.89.215 |
| Public IPv6 | 2a01:4f9:3051:442c::2/64 |
| Interface | enp41s0 |
| Open ports | 22 (SSH), 53 (systemd-resolved localhost) |
| Firewall | ufw inactive — full exposure |
| Tailscale | Not installed |
| Headscale | Not installed |
2.3 Software Inventory
| Component | Status | Notes |
|---|---|---|
| Hermes Agent | ✅ Running | v0.11.0, gateway process active, Telegram platform connected |
| Python | ✅ Available | 3.11.15 |
| Node.js | ✅ Available | v22.22.2 |
| pip/poetry | ❌ Missing | Hermes uses its own venv; no global pip |
| Docker | ❌ Not installed | docker-compose.yml exists in repo but unused |
| Podman | ❌ Not installed | |
| PostgreSQL | ❌ Not installed | |
| Redis | ❌ Not installed | |
| SQLite | ✅ Used by Hermes | ~/.hermes/state.db |
| nginx/Caddy/Traefik | ❌ Not installed | |
| Headscale/Tailscale | ❌ Not installed |
2.4 Hermes Configuration Gaps
webtoolset backend unconfigured — no Firecrawl, Exa, Tavily, or Parallel keys set.providers: {}empty — no fallback or auxiliary provider routing.toolsets:only listshermes-cliandhermes-telegram— missingweb,browser,file,terminal, etc.- No API server exposed (
API_SERVER_KEYcommented out in docker-compose.yml). - 16 commits behind upstream (
hermes updateavailable).
3. Target Architecture
┌──────────────────────────────────────────────────────────────────────────────────────────┐
│ ProDG Studios Mainframe (VPS) │
│ 65.109.89.215 • Ubuntu 24.04 • Hetzner-style │
└──────────────────────────────────────────────────────────────────────────────────────────┘
│
┌──────────────────────────────────────────────────────────────────────────────────────────┐
│ Tailscale Mesh (Headscale DERP) │
│ 100.64.0.0/10 CGNAT • WireGuard • Custom Headscale Control │
└──────────────────────────────────────────────────────────────────────────────────────────┘
│ │ │
┌───────────┐ ┌───────────┐ ┌───────────┐ ┌───────────┐
│ Dev Laptop │ │ Agent Node 1│ │ Agent Node 2│ │ CI Runner │
│ (Tailscale) │ │ (Tailscale) │ │ (Tailscale) │ │ (Tailscale) │
└───────────┘ └───────────┘ └───────────┘ └───────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────┐
│ MAINFRAME INTERNAL STACK │
├──────────────────────────────────────────────────────────────────────────────────────────┤
│ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ ┌───────────────┐ │
│ │ Caddy RP │ │ PostgreSQL │ │ Redis │ │ Hermes │ │ Prometheus │ │
│ │ (:80/:443) │ │ (15/16) │ │ (Cache/Sess) │ │ Gateway/API │ │ + Grafana │ │
│ └───────────────┘ └───────────────┘ └───────────────┘ └───────────────┘ └───────────────┘ │
└───────────────────────────────────────────────────────────────────────────────────────────┘
┌──────────────────────────────────────────────────────────────────────────────────────────┐
│ DOCKER COMPOSE SERVICES ( Planned ) │
│ • headscale (control server) • postgres (db) │
│ • tailscale (mesh client) • redis (cache/queue) │
│ • caddy (reverse proxy) • minio (S3-compatible object store) │
│ • hermes-gw (gateway) • prometheus (metrics) │
│ • hermes-dash (dashboard) • grafana (visualization) │
└──────────────────────────────────────────────────────────────────────────────────────────┘
4. Implementation Phases
Phase 0: Pre-Flight Security Hardening — Before anything else
| Step | Action | Command / Config |
|---|---|---|
| 0.1 | Activate ufw | ufw default deny incoming, ufw allow ssh, ufw enable |
| 0.2 | Harden SSH | PasswordAuthentication no, PermitRootLogin prohibit-password, fail2ban |
| 0.3 | Auto-updates | apt install unattended-upgrades, configure 50unattended-upgrades |
| 0.4 | Create service user | useradd -m -s /bin/bash prodg — run Hermes & containers as non-root |
| 0.5 | Set hostname | hostnamectl set-hostname mainframe.prodg.studio |
Validation: ss -tlnp shows only 22 externally; ufw status verbose confirms default deny.
Phase 1: Container Runtime & Compose Stack
| Step | Action | Rationale |
|---|---|---|
| 1.1 | Install Docker CE + Compose plugin | Industry standard; Hermes already ships a docker-compose.yml |
| 1.2 | Install docker.io or Docker CE repo | Prefer official Docker repo for latest compose plugin |
| 1.3 | Add prodg user to docker group | Allow non-root container management |
| 1.4 | Verify with docker run hello-world | |
| 1.5 | Create /opt/prodg/compose/ | Central location for all stack definitions |
Validation: docker compose version returns v2.x; docker ps works as prodg user.
Phase 2: Tailscale Mesh (Headscale Control Server)
Since you mentioned a custom Headscale instance, the mainframe will host the control plane.
| Step | Action | Details |
|---|---|---|
| 2.1 | Deploy Headscale via Docker | Image: headscale/headscale:latest |
| 2.2 | Persist config & DB | Volumes: ./headscale/config/:/etc/headscale/, ./headscale/data/:/var/lib/headscale |
| 2.3 | Configure config.yaml | server_url: https://headscale.prodg.studio or Tailnet IP; listen_addr: 0.0.0.0:8080; magic_dns: true |
| 2.4 | Generate pre-auth keys | headscale preauthkeys create --user prodg --reusable --expiration 24h |
| 2.5 | Install Tailscale on mainframe | tailscale up --login-server https://headscale.prodg.studio |
| 2.6 | Expose Headscale UI (optional) | juanfont/headscale-ui or ghcr.io/gurucomputing/headscale-ui behind Caddy |
Key ports: Headscale control (8080), DERP/STUN (3478/udp).
Validation: tailscale status shows mainframe as a node; headscale nodes list returns entries.
Phase 3: Data Layer
3.1 PostgreSQL 16
| Property | Value |
|---|---|
| Container | postgres:16-alpine |
| Data dir | /opt/prodg/data/postgres/ |
| Databases | hermes, agents, analytics |
| Network | Tailscale IP only (no public exposure) |
| Backups | pg_dump daily via cron to /opt/prodg/backups/ |
3.2 Redis 7
| Property | Value |
|---|---|
| Container | redis:7-alpine |
| Use | Hermes session cache, Celery/queue broker, rate-limiting |
| Persistence | AOF + RDB |
| Password | requirepass via Docker secret or env |
3.3 MinIO (S3-Compatible Object Storage)
| Property | Value |
|---|---|
| Container | minio/minio:latest |
| Buckets | prodg-artifacts, prodg-logs, prodg-models |
| Use | Model artifacts, generated media, log archives |
| Console | Exposed on Tailscale only or via Caddy basic-auth |
Validation: pg_isready, redis-cli ping, mc alias set all succeed from mainframe.
Phase 4: Hermes Mainframe Hardening
| Step | Action | Details |
|---|---|---|
| 4.1 | Update Hermes | hermes update (16 commits behind) |
| 4.2 | Enable web toolset | Add web to toolsets: in config.yaml |
| 4.3 | Configure web backend | Set web.backend: firecrawl + FIRECRAWL_API_KEY or wire Perplexity as a custom provider |
| 4.4 | Enable file + terminal + browser toolsets | Ensure core toolsets are loaded |
| 4.5 | Configure fallback model | Uncomment fallback_model block in config.yaml using OpenRouter |
| 4.6 | Enable API server | Set API_SERVER_HOST=0.0.0.0, API_SERVER_KEY=<strong-secret> in compose env |
| 4.7 | Move Hermes to Docker Compose | Use the existing docker-compose.yml with UID/GID mapping |
| 4.8 | Mount persistent volumes | ~/.hermes:/opt/data, plus socket to Docker for container ops |
Hermes config additions (~/.hermes/config.yaml):
toolsets:
- hermes-cli
- hermes-telegram
- web
- file
- terminal
- browser
providers:
perplexity:
base_url: https://api.perplexity.ai
api_key: ${PERPLEXITY_API_KEY}
models:
- sonar
- sonar-pro
- sonar-reasoning
fallback_model:
provider: openrouter
model: anthropic/claude-sonnet-4
Validation: hermes tools shows web backend healthy; API server responds with auth key.
Phase 5: Reverse Proxy & Ingress (Caddy)
| Service | Public/Tailscale | Caddy Route |
|---|---|---|
| Hermes Dashboard | Tailscale only | dash.mainframe.prodg.ts.net |
| Hermes API | Tailscale + mTLS | api.mainframe.prodg.ts.net |
| Headscale UI | Tailscale only | headscale.prodg.studio (if public) |
| Grafana | Tailscale only | metrics.mainframe.prodg.ts.net |
| MinIO Console | Tailscale only | s3.mainframe.prodg.ts.net |
Why Caddy over nginx: Automatic HTTPS (even for Tailscale DNS via Tailscale cert), simpler config, HTTP/3 by default.
Validation: All endpoints reachable via Tailscale FQDN; Caddy serves valid certificates.
Phase 6: Observability
| Component | Stack | Purpose |
|---|---|---|
| Metrics | Prometheus + node_exporter | CPU, RAM, disk, network, container stats |
| Logs | Promtail + Loki (or Grafana Alloy) | Centralized log aggregation from all containers |
| Dashboards | Grafana | Pre-built dashboards for node, Docker, Hermes gateway |
| Alerting | Grafana Alerting → Telegram/Discord | High CPU, disk full, Hermes gateway down |
Validation: Grafana shows real-time metrics; alert fires on systemd service failure.
Phase 7: Multi-Agent Orchestration
This is the ProDG Studios differentiator. Hermes becomes the conductor; other agents are players.
7.1 Agent Registry
- A PostgreSQL table
agentstracking each connected agent:agent_id,name,tailscale_ip,capabilities[],last_heartbeat,status
- Hermes exposes a
/agentsREST endpoint via its API server.
7.2 Agent Types (Planned)
| Agent | Role | Tooling |
|---|---|---|
hermes-orchestrator (this node) | Central dispatcher, user-facing chat | Full toolset |
code-agent-01 | Feature implementation, PRs | claude-code / codex / opencode via ACP |
research-agent-01 | Literature review, data synthesis | arxiv, blogwatcher, web_search |
infra-agent-01 | IaC, deployment, monitoring | terraform, ansible, docker tools |
creative-agent-01 | Media generation, design | image_gen, p5js, manim-video |
7.3 Inter-Agent Communication
- Synchronous: Hermes
delegate_task→ ACP subagents - Asynchronous: Redis pub/sub channels per agent topic
- Persistent: PostgreSQL job queue (or LiteQueue on SQLite for simplicity)
7.4 Deployment Model
Each agent type runs as:
- A Docker container on the mainframe (for trusted agents), OR
- A remote Tailscale node (for untrusted / high-compute agents), OR
- An ephemeral Modal/Daytona container (for burst workloads)
Validation: Hermes can spawn a subagent, delegate a task, receive results, and store them in PostgreSQL.
Phase 8: Backup & Disaster Recovery
| Data | Frequency | Target | Method |
|---|---|---|---|
~/.hermes/ (config, state, memories) | Hourly | MinIO prodg-backups | restic or rclone sync |
| PostgreSQL | Daily | MinIO + offsite | pg_dump + restic |
| Redis | Hourly | MinIO | redis-cli --rdb |
| Headscale DB | Daily | MinIO | Volume snapshot |
Offsite: Configure a second rclone remote (Backblaze B2, Wasabi, or another Hetzner box) for 3-2-1 compliance.
Validation: Restore test: spin up a fresh VM, restore from backup, Hermes resumes with full memory.
5. Port & Service Matrix
| Port | Protocol | Service | Exposure |
|---|---|---|---|
| 22 | TCP | SSH | Public (fail2ban hardened) |
| 80 | TCP | Caddy HTTP redirect | Public |
| 443 | TCP | Caddy HTTPS | Public |
| 8080 | TCP | Headscale control | Public (mTLS/auth) |
| 3478 | UDP | Headscale DERP/STUN | Public |
| 5432 | TCP | PostgreSQL | Tailscale only |
| 6379 | TCP | Redis | Tailscale only |
| 9000 | TCP | MinIO S3 API | Tailscale only |
| 9001 | TCP | MinIO Console | Tailscale only |
| 9090 | TCP | Prometheus | Tailscale only |
| 3000 | TCP | Grafana | Tailscale only |
| 8000 | TCP | Hermes API server | Tailscale + API key |
| 8081 | TCP | Hermes Dashboard | Tailscale + auth |
6. Files Likely to Change
~/.hermes/config.yaml— toolsets, providers, fallback model/opt/prodg/compose/docker-compose.yml— full stack definition/opt/prodg/compose/Caddyfile— reverse proxy routes/opt/prodg/compose/headscale/config.yaml— Tailnet control plane/etc/ssh/sshd_config— SSH hardening/etc/fail2ban/jail.local— brute-force protection/opt/prodg/scripts/backup.sh— automated backup orchestration/usr/local/lib/hermes-agent/docker-compose.yml— reference only (prefer /opt/prodg copy)
7. Risks, Tradeoffs, and Open Questions
| Risk | Impact | Mitigation |
|---|---|---|
| Single point of failure (one VPS) | High | Backup to offsite; plan hot-standby replica on second Hetzner node |
| Running everything as root currently | Critical | Phase 0 creates prodg user; migrate Hermes process |
| Headscale UI public exposure | Medium | Bind to Tailscale IP only; Caddy basic-auth as second layer |
| Hermes v0.11.0 rapid iteration | Medium | Pin to release tags; test updates in staging container first |
| 62 GB RAM may not suffice for LLM inference | Low | Offload inference to Modal/Daytona or dedicated GPU nodes; mainframe stays orchestrator-only |
| No GPU on this box | N/A by design | Creative/media agents run on GPU nodes elsewhere |
Open Questions:
- Do you own a domain (
prodg.studio)? If so, we should set up DNS + Tailscale Funnel for selective public exposure. - What is your offsite backup budget? (Backblaze B2 is $0.005/GB/month; Wasabi is $6.99/TB/month flat.)
- Do you need the Hermes API server exposed to the public internet, or strictly Tailscale-internal?
- Should agent workloads run on this same box (containers) or strictly on remote Tailscale nodes?
8. Immediate Next Steps (This Session)
If you approve this plan, the first 3 commands to run are:
# 1. Create service user useradd -m -s /bin/bash prodg # 2. Harden SSH + firewall ufw default deny incoming ufw allow ssh ufw enable sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config systemctl restart sshd # 3. Install Docker apt-get update && apt-get install -y ca-certificates curl gnupg install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg chmod a+r /etc/apt/keyrings/docker.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" > /etc/apt/sources.list.d/docker.list apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin usermod -aG docker prodg
Then proceed to Phase 2 (Headscale) and Phase 3 (Data Layer) in sequence.
9. Success Criteria
The mainframe is fully operational when:
- [ ]
ufwis active and only SSH/HTTP/HTTPS are public; all DBs are Tailscale-internal. - [ ] Headscale is running; at least one remote node (your dev laptop) is joined to the Tailnet.
- [ ]
docker compose psshows healthy containers for Postgres, Redis, Caddy, Hermes gateway, and Prometheus. - [ ] Hermes responds to a
web_searchquery with grounded results. - [ ] The Hermes API server answers authenticated requests from a remote Tailscale node.
- [ ] Grafana dashboard displays node + Docker + Hermes metrics.
- [ ] A
delegate_taskcall from Hermes successfully dispatches work to a subagent and records results in PostgreSQL. - [ ] Nightly backups run without error and a restore test passes.
End of Plan.