What happens to your AI coding agent when you close your laptop or lose your Wi-Fi connection? If you are running them locally, the progress stops immediately.
The Simple Version
Imagine you have a highly efficient personal assistant who does all your coding. If you keep this assistant in your home office, they have to stop working the moment you turn off the lights and go to bed.
Moving your agents to the cloud is like moving that assistant to a professional, 24/7 office building. You can visit them from your laptop, your tablet, or even your phone, but the assistant never stops working just because you left the room.
In this setup, Herdr acts as the office manager, organizing different "rooms" (sessions) for different agents like Claude or Codex, while the VPS (Virtual Private Server) acts as the building itself.
How It Works
The Persistent Workspace
Most developers run AI agents directly in their local terminal. The problem is that these sessions are tied to the lifecycle of your computer's operating system and your active connection.
By using a VPS, you are renting a slice of a powerful server in a data center. When you connect to it via SSH (Secure Shell), you aren't just running a command; you are entering a remote environment that stays powered on indefinitely.
The Role of Herdr
Herdr is a terminal multiplexer specifically designed for AI agents. As Dave Ebbelaar notes, it allows you to "start cloud sessions," "start a codex session," and manage different "harnesses" all in one place.
Because Herdr runs on the server, it maintains the state of your terminal. If your internet drops, the Herdr session on the server remains active, waiting for you to reconnect.
Technical Deep Dive
Server Architecture and Security
To build a production-ready environment, the setup follows a specific security hierarchy. First, a VPS is provisioned—ideally with at least 8GB of RAM to handle the overhead of multiple LLM-driven processes.
Security is handled in three layers:
- SSH Keys: Instead of relying solely on passwords, you use asymmetric cryptography. You generate an SSH key pair on your local machine and add the public key to the VPS, ensuring only your specific device can authenticate.
- Dedicated Developer User: For security best practices, you should not run agents as the root user. The setup involves creating a separate user with limited permissions to prevent accidental system-wide configuration changes.
- IP Whitelisting: By using a firewall (like the one provided in the Hostinger dashboard), you can restrict SSH access (Port 22) to only your specific IP address or a dedicated VPN IP.
Agent Authentication via Device Flow
A common technical hurdle when running agents on remote servers is that they often try to open a web browser for authentication (OAuth). Since a headless VPS has no GUI or browser, you must use the device authentication flow.
When you run commands like claude auth login or codex login device, the server generates a unique code. You then copy this code, paste it into a browser on your local machine, and authorize the connection there. This bridges the gap between your secure local browser and the remote terminal.
The Hybrid Workflow: Terminal + GUI
One of the most powerful aspects of this setup is the ability to combine terminal-based agent execution with a visual IDE. You can use the Remote - SSH extension in VS Code or Cursor to connect directly to your VPS.
As Ebbelaar demonstrates, this allows you to "open up this entire project here inside Cursor" to view files, make manual edits, and manage version control without needing to do everything via the terminal. This creates a dual-track workflow:
- The Agent Track: Keep a Herdr session open in a terminal to let the agent perform autonomous tasks.
- The Human Track: Use Cursor or VS Code to navigate the file system, handle commits, and manage Pull Requests (PRs) visually.
For advanced developers, this also enables port forwarding. If an agent runs a web application on a localhost inside the VPS, you can port that traffic to your local device to preview the app in your own browser.
Why This Matters
As AI agents move from simple chat interfaces to autonomous coding entities, the bottleneck is no longer the model's intelligence, but the stability of the execution environment. Local execution is fragile; cloud execution is robust.
This setup shifts the paradigm from "AI as a tool I use" to "AI as a teammate that works for me." By offloading the compute and the session management to a VPS, you can assign complex, multi-step coding tasks to your agents and walk away, knowing they will deliver the finished pull request by the time you return.