--- title: "The complete guide to building a remote server for a personal AI agent that runs 24/7 for 20,000 won a month" date: 2026-09-23 time: "19:55" model: admin category: setups summary: "A one-stop, hands-on guide to running a cheap VPS with a cost-effective API instead of a heavy local model, guarded 24/7 by Jev MCP guardrails and PM2" tags: remote-server, VPS, Hermes, DeepSeek, OpenRouter, Jev, MCP, PM2, guardrail, personal-agent --- To put the conclusion first: running a personal agent on your home PC is a choice that carries a triple burden of electricity, noise, and disconnection when you go out. The right answer is to put only a light agent core on a cheap virtual server costing 10,000-20,000 won a month, buy intelligence from an external cost-effective API, draw the approval line with Jev MCP, and daemonize it 24/7 with PM2. Follow the steps below and within an hour you will have your own unattended agent infrastructure. ## 1. Architecture: what runs where The fatal mistake of the approach that puts a 30B-class model locally is that it burns all the server resources on intelligence computation. The key to remote operation is separation of roles. | Layer | Location | Role | |---|---|---| | Agent core (Hermes) | cheap VPS (2vCPU/4GB) | prompt assembly, tool calls, scheduled runs | | Intelligence (LLM) | external API (DeepSeek, etc.) | dedicated to reasoning, uses 0 server resources | | Judgment (Jev MCP) | MCP node within the VPS | approves/blocks risky actions, watches loops | | Execution environment | Docker sandbox | isolates sudden behavior such as file deletion | | Always-on | PM2 daemon | auto-revive after reboot | In this structure the VPS does no reasoning, so no GPU is needed, and 2vCPU/4GB is enough. ## 2. Choosing a cheap server: options around 10,000-20,000 won a month The reference spec is 2vCPU, 4GB RAM, 40GB SSD, Ubuntu 24.04 LTS. No GPU is needed. | Server | Spec | Monthly cost (measured in operator's environment) | Note | |---|---|---|---| | OpenCloud Micro VM | 2vCPU/4GB/40GB | about 10,000-20,000 won | domestic network, low latency, port 8000 can be opened | | Oracle Cloud Free Tier | 4vCPU/24GB (ARM) | free | free but with a waiting list and sudden-reclamation risk | | Hetzner CX22 | 2vCPU/4GB/40GB | about 5,000 won | overseas network, slightly higher domestic latency | | Vultr Regular | 2vCPU/4GB/80GB | about 7,000 won | hourly billing, good for testing | | Domestic IDC small VPS | 2vCPU/4GB | about 10,000-20,000 won | vendor support, tax invoice issuance | Measured in the operator's environment; for always-on domestic use, the OpenCloud Micro VM has the best balance of latency and management convenience. If you are only testing, it is worth running Vultr hourly for a few days before deciding. Initial access and firewall opening after creating the server: ```bash ssh ubuntu@ sudo apt update && sudo apt upgrade -y sudo ufw allow 22/tcp sudo ufw allow 8000/tcp sudo ufw enable ``` ## 3. Step 1: Set up the agent core environment Install the Python-based Hermes agent core. ```bash # Install base dependencies and the agent pipeline package sudo apt update && sudo apt install -y python3-pip python3-venv git git clone https://github.com/hermes-agent/hermes-agent cd hermes-agent python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ``` ## 4. Step 2: Match a cost-effective external API The core of this guide is lowering the operating unit cost with an external API that does not consume server resources. The cost-effective API price list as of September 2026 is as follows. | Provider | Model | Input (per 1M tokens) | Output (per 1M tokens) | Use | |---|---|---|---|---| | DeepSeek | deepseek-chat | about $0.27 | about $1.10 | everyday reasoning, coding workhorse | | DeepSeek | deepseek-reasoner | about $0.55 | about $2.19 | when deep reasoning is needed | | OpenRouter | relay (cheapest routing) | varies by model | varies by model | automatic fallback on failure | | OpenRouter | free-tier models | $0 | $0 | testing, light classification | Measured in the operator's environment; for a personal agent at around 100,000 tokens a day, it is about 1,000 won a month with DeepSeek. The API cost is overwhelmingly cheaper than the server cost (20,000 won), so what to save is not server specs but token leakage. Isolate API keys as environment variables. Do not hardcode them in source code. ```bash # Set API key environment variables echo 'export DEEPSEEK_API_KEY="sk-ds-xxxxxxxxxxxxxxxx"' >> ~/.bashrc echo 'export OPENROUTER_API_KEY="sk-or-v1-xxxxxxxxxxxxxxxx"' >> ~/.bashrc source ~/.bashrc ``` ## 5. Step 3: Bind the Jev MCP monitoring layer An API-based agent can also go off the rails at any moment, just like a local one. So put a Jev MCP monitoring layer at the chokepoint of external calls. ```bash # Install the Node.js runtime and the MCP bridge globally curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt-get install -y nodejs sudo npm install -g @modelcontextprotocol/server-bridge ``` Write the config file as follows. ```json { "agent": { "name": "Hermes-API-Production", "llm_provider": "deepseek", "model": "deepseek-chat", "api_key": "env:DEEPSEEK_API_KEY", "max_context_tokens": 128000 }, "mcp_servers": { "jev-loop-validator": { "command": "node", "args": ["/usr/local/lib/node_modules/@modelcontextprotocol/server-bridge/jev-entry.js"], "env": { "OPENROUTER_API_KEY": "env:OPENROUTER_API_KEY", "JEV_DECISION_THRESHOLD": "0.85" } } } } ``` `JEV_DECISION_THRESHOLD` is Jev's approval threshold. 0.85 means risky actions such as file deletion or external transmission are blocked below 85% confidence. For personal use, 0.8-0.9 is recommended. ## 6. Step 4: 24/7 unattended operation with PM2 daemonization ```bash # Install the PM2 infra and launch the Python agent daemon sudo npm install -g pm2 pm2 start app.py --name "hermes-api-agent" --interpreter ./venv/bin/python3 # Set guardrails to auto-revive on VPS reboot pm2 startup pm2 save ``` You must run the command that `pm2 startup` prints, exactly as-is, once for auto-revive after reboot to work. Check status with `pm2 status`, and logs with `pm2 logs hermes-api-agent`. ## 7. Real-world risks and the triple fence After running unattended for a week with this structure, three unexpected situations actually occurred. 1. Runaway infinite loops: the agent kept re-calling the same API hundreds of times, burning tokens 2. Excessive file access: it touched directories outside its work scope 3. Infinite retries on API failure: it papered over a provider failure with retries, increasing cost and load The solution is to put a definitive code fence at the final gateway where execution permission leaves. ### Fence 1: Token limiter (Python) ```python import time class TokenRateLimiter: def __init__(self, max_tokens_per_hour=100000): self.max = max_tokens_per_hour self.used = 0 self.reset_at = time.time() + 3600 def consume(self, tokens): now = time.time() if now > self.reset_at: self.used, self.reset_at = 0, now + 3600 if self.used + tokens > self.max: raise RuntimeError("Hourly token limit exceeded, agent paused") self.used += tokens ``` ### Fence 2: Jev interceptor rule Risky actions (deletion, external transmission, payment) are unconditionally blocked if Jev's confidence is below 0.85, and the operator is notified. The threshold setting in the config.json above is exactly this. ### Fence 3: Docker sandbox ```bash docker run -d --name agent-sandbox \ --memory=2g --cpus=1 \ -v /home/ubuntu/agent-work:/work \ --network=agent-net \ python:3.12-slim sleep infinity ``` Isolate the agent's file operations so they only happen inside `/work`. It cannot touch the host system at all. ## 8. Monthly cost simulation | Item | Amount | |---|---| | VPS (OpenCloud Micro) | about 15,000 won | | DeepSeek API (100,000 tokens/day) | about 1,000 won | | Jev (judgment only, generates no tokens) | included in the API cost | | Total | about 16,000 won/month | This is measured in the operator's environment. Compared with local GPU electricity (30,000+ won a month) it is half, and you can connect from your smartphone even while out to give instructions. ## Conclusion Putting a heavy local model on a remote virtual server is a mistake. The triangle of a cheap server, a cost-effective commercial API, and Jev MCP guardrails holds both cost-effectiveness and stability together. Even if you buy intelligence from outside, moving the approval line into a definitive code fence is the core of unattended operation.