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

ResourceValue
OSUbuntu 24.04.3 LTS (Noble)
Kernel6.8.0-100-generic
CPUAMD Ryzen 5 3600 (6c/12t) @ ~4.2 GHz boost
RAM62 GB (utilization: ~2%)
Storage2 × 476 GB NVMe (RAID1) → 436 GB usable (utilization: ~2%)
Load avg0.13 (essentially idle)

2.2 Network

PropertyValue
Public IPv465.109.89.215
Public IPv62a01:4f9:3051:442c::2/64
Interfaceenp41s0
Open ports22 (SSH), 53 (systemd-resolved localhost)
Firewallufw inactive — full exposure
TailscaleNot installed
HeadscaleNot installed

2.3 Software Inventory

ComponentStatusNotes
Hermes Agent✅ Runningv0.11.0, gateway process active, Telegram platform connected
Python✅ Available3.11.15
Node.js✅ Availablev22.22.2
pip/poetry❌ MissingHermes uses its own venv; no global pip
Docker❌ Not installeddocker-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

  • web toolset backend unconfigured — no Firecrawl, Exa, Tavily, or Parallel keys set.
  • providers: {} empty — no fallback or auxiliary provider routing.
  • toolsets: only lists hermes-cli and hermes-telegram — missing web, browser, file, terminal, etc.
  • No API server exposed (API_SERVER_KEY commented out in docker-compose.yml).
  • 16 commits behind upstream (hermes update available).

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

StepActionCommand / Config
0.1Activate ufwufw default deny incoming, ufw allow ssh, ufw enable
0.2Harden SSHPasswordAuthentication no, PermitRootLogin prohibit-password, fail2ban
0.3Auto-updatesapt install unattended-upgrades, configure 50unattended-upgrades
0.4Create service useruseradd -m -s /bin/bash prodg — run Hermes & containers as non-root
0.5Set hostnamehostnamectl set-hostname mainframe.prodg.studio

Validation: ss -tlnp shows only 22 externally; ufw status verbose confirms default deny.


Phase 1: Container Runtime & Compose Stack

StepActionRationale
1.1Install Docker CE + Compose pluginIndustry standard; Hermes already ships a docker-compose.yml
1.2Install docker.io or Docker CE repoPrefer official Docker repo for latest compose plugin
1.3Add prodg user to docker groupAllow non-root container management
1.4Verify with docker run hello-world
1.5Create /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.

StepActionDetails
2.1Deploy Headscale via DockerImage: headscale/headscale:latest
2.2Persist config & DBVolumes: ./headscale/config/:/etc/headscale/, ./headscale/data/:/var/lib/headscale
2.3Configure config.yamlserver_url: https://headscale.prodg.studio or Tailnet IP; listen_addr: 0.0.0.0:8080; magic_dns: true
2.4Generate pre-auth keysheadscale preauthkeys create --user prodg --reusable --expiration 24h
2.5Install Tailscale on mainframetailscale up --login-server https://headscale.prodg.studio
2.6Expose 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

PropertyValue
Containerpostgres:16-alpine
Data dir/opt/prodg/data/postgres/
Databaseshermes, agents, analytics
NetworkTailscale IP only (no public exposure)
Backupspg_dump daily via cron to /opt/prodg/backups/

3.2 Redis 7

PropertyValue
Containerredis:7-alpine
UseHermes session cache, Celery/queue broker, rate-limiting
PersistenceAOF + RDB
Passwordrequirepass via Docker secret or env

3.3 MinIO (S3-Compatible Object Storage)

PropertyValue
Containerminio/minio:latest
Bucketsprodg-artifacts, prodg-logs, prodg-models
UseModel artifacts, generated media, log archives
ConsoleExposed 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

StepActionDetails
4.1Update Hermeshermes update (16 commits behind)
4.2Enable web toolsetAdd web to toolsets: in config.yaml
4.3Configure web backendSet web.backend: firecrawl + FIRECRAWL_API_KEY or wire Perplexity as a custom provider
4.4Enable file + terminal + browser toolsetsEnsure core toolsets are loaded
4.5Configure fallback modelUncomment fallback_model block in config.yaml using OpenRouter
4.6Enable API serverSet API_SERVER_HOST=0.0.0.0, API_SERVER_KEY=<strong-secret> in compose env
4.7Move Hermes to Docker ComposeUse the existing docker-compose.yml with UID/GID mapping
4.8Mount 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)

ServicePublic/TailscaleCaddy Route
Hermes DashboardTailscale onlydash.mainframe.prodg.ts.net
Hermes APITailscale + mTLSapi.mainframe.prodg.ts.net
Headscale UITailscale onlyheadscale.prodg.studio (if public)
GrafanaTailscale onlymetrics.mainframe.prodg.ts.net
MinIO ConsoleTailscale onlys3.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

ComponentStackPurpose
MetricsPrometheus + node_exporterCPU, RAM, disk, network, container stats
LogsPromtail + Loki (or Grafana Alloy)Centralized log aggregation from all containers
DashboardsGrafanaPre-built dashboards for node, Docker, Hermes gateway
AlertingGrafana Alerting → Telegram/DiscordHigh 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 agents tracking each connected agent:
    • agent_id, name, tailscale_ip, capabilities[], last_heartbeat, status
  • Hermes exposes a /agents REST endpoint via its API server.

7.2 Agent Types (Planned)

AgentRoleTooling
hermes-orchestrator (this node)Central dispatcher, user-facing chatFull toolset
code-agent-01Feature implementation, PRsclaude-code / codex / opencode via ACP
research-agent-01Literature review, data synthesisarxiv, blogwatcher, web_search
infra-agent-01IaC, deployment, monitoringterraform, ansible, docker tools
creative-agent-01Media generation, designimage_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:

  1. A Docker container on the mainframe (for trusted agents), OR
  2. A remote Tailscale node (for untrusted / high-compute agents), OR
  3. 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

DataFrequencyTargetMethod
~/.hermes/ (config, state, memories)HourlyMinIO prodg-backupsrestic or rclone sync
PostgreSQLDailyMinIO + offsitepg_dump + restic
RedisHourlyMinIOredis-cli --rdb
Headscale DBDailyMinIOVolume 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

PortProtocolServiceExposure
22TCPSSHPublic (fail2ban hardened)
80TCPCaddy HTTP redirectPublic
443TCPCaddy HTTPSPublic
8080TCPHeadscale controlPublic (mTLS/auth)
3478UDPHeadscale DERP/STUNPublic
5432TCPPostgreSQLTailscale only
6379TCPRedisTailscale only
9000TCPMinIO S3 APITailscale only
9001TCPMinIO ConsoleTailscale only
9090TCPPrometheusTailscale only
3000TCPGrafanaTailscale only
8000TCPHermes API serverTailscale + API key
8081TCPHermes DashboardTailscale + 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

RiskImpactMitigation
Single point of failure (one VPS)HighBackup to offsite; plan hot-standby replica on second Hetzner node
Running everything as root currentlyCriticalPhase 0 creates prodg user; migrate Hermes process
Headscale UI public exposureMediumBind to Tailscale IP only; Caddy basic-auth as second layer
Hermes v0.11.0 rapid iterationMediumPin to release tags; test updates in staging container first
62 GB RAM may not suffice for LLM inferenceLowOffload inference to Modal/Daytona or dedicated GPU nodes; mainframe stays orchestrator-only
No GPU on this boxN/A by designCreative/media agents run on GPU nodes elsewhere

Open Questions:

  1. Do you own a domain (prodg.studio)? If so, we should set up DNS + Tailscale Funnel for selective public exposure.
  2. What is your offsite backup budget? (Backblaze B2 is $0.005/GB/month; Wasabi is $6.99/TB/month flat.)
  3. Do you need the Hermes API server exposed to the public internet, or strictly Tailscale-internal?
  4. 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:

  • [ ] ufw is 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 ps shows healthy containers for Postgres, Redis, Caddy, Hermes gateway, and Prometheus.
  • [ ] Hermes responds to a web_search query with grounded results.
  • [ ] The Hermes API server answers authenticated requests from a remote Tailscale node.
  • [ ] Grafana dashboard displays node + Docker + Hermes metrics.
  • [ ] A delegate_task call 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.