How to host an AI agent 24/7

We may earn commissions when you shop through the links below. Learn more

Choosing between a VPS, managed platform or GPU instance for always-on agents: persistence, secrets, backups and cost.

  • By AIHostCompare
  • Published
  • Updated
  • 10 sources · Decision guide
On this page10 sections

Summary

Most agents that call a hosted model API do not need a GPU. A small always-on Linux server or container is enough, provided it has a process supervisor, persistent storage, secrets kept out of the code and backups that leave the machine. Managed platforms take restarts and deploys off your hands, but check their scale-to-zero defaults, or a background agent stops when no requests arrive. Rent a GPU only when the agent runs its own model, and size it for the context length the agent needs. Budget with the price a plan renews at, not an introductory first-term price.

  • API-backed agents run on a small VPS or container; the model bill is separate from hosting.
  • Keep it running with a supervisor: a systemd service, a container restart policy or a platform set to always-on.
  • Keep its state: persistent storage plus off-machine backups of memory, sessions and configuration.
  • Contain it: private admin access, allow-listed senders, sandboxed tools and secrets outside the workspace.
  • Budget with the renewal price: an always-on agent outlives any introductory term.

1. What “always on” actually requires

An agent that runs around the clock is a long-running process with state. It listens to chat channels or webhooks, runs scheduled work and remembers earlier conversations. OpenClaw, for example, is a self-hosted gateway that connects messaging apps such as WhatsApp, Telegram, Slack and Signal to AI agents, and its setup guide describes an “always-on AI assistant” . Hermes Agent’s documentation says it can live on a small VPS, a GPU cluster or serverless infrastructure that hibernates when idle .

Whatever the framework, “24/7” means the host has to provide six things:

  • a process that comes back after a crash and after a reboot;
  • state that survives restarts and redeploys: memory, sessions, credentials, configuration;
  • a way to receive events: an inbound HTTPS endpoint for webhooks, or outbound polling;
  • scheduled work (heartbeats, cron jobs) that runs even when nobody is talking to the agent;
  • logs and alerts, so you notice when it stops;
  • a spending cap on the model API, because an always-on agent spends money while you sleep.

2. Choose the hosting model: VPS, platform or GPU

Where to run an always-on agent

  • VPS or cloud server

    Good fit
    Agents that call a hosted model API; full control; a predictable monthly price.
    Watch out for
    You patch the OS, set up the service manager and handle backups yourself.
  • Managed container platform

    Good fit
    Deploys from a repository or image, with restarts and TLS handled for you.
    Watch out for
    Scale-to-zero defaults can stop a background agent; volumes may be tied to one host.
  • Serverless sandbox

    Good fit
    Agents that are idle most of the time and can wait for a cold start.
    Watch out for
    State must live outside the sandbox; long-lived connections are harder.
  • GPU instance

    Good fit
    Agents that run their own model instead of calling an API.
    Watch out for
    The GPU bills every hour it is on; size it with the VRAM arithmetic first.

The deciding question is where the model runs. If the agent calls a hosted model, the host only needs CPU, memory and disk. If it runs its own model, the model’s memory need decides everything else. Hermes Agent, for instance, requires a model with at least 64,000 tokens of context and asks local-model users to set it explicitly, for example --ctx-size 65536 for llama.cpp or -c 65536 for Ollama . A 64K-token context has a real memory cost, which the VRAM guide shows how to estimate.

3. Size the server

An API-backed gateway is light. OpenClaw’s DigitalOcean guide runs it on 1 vCPU, 1 GB of RAM and a 25 GB SSD, recommends adding swap on 1 GB machines, prefers hosted models because “local LLM inference does not fit in 1 GB”, and suggests moving to 2 GB if you still run out of memory . Browser automation, code-execution sandboxes and local embedding models all raise that floor, so watch the memory peak for a few days before you downsize.

Follow the framework’s own install guide for your host where one exists. OpenClaw’s documentation links step-by-step guides for 14 hosting targets, including DigitalOcean, Fly.io and Hetzner .

The cheapest verified plan per provider that clears a 2 GB floor:

Cheapest verified plan with at least 2 GB RAM, per provider

Scroll sideways for all columns.

Cheapest verified plan with at least 2 GB RAM, per provider
ProviderPlanvCPU / RAMPer monthOpenClawHermes Agent
OVHcloudVPS-1 (VPS 2027 range)2 / 4 GB≈ $5.12 (converted from the EUR list price, €4.49)€4.49 /monthDocumented setupDocumented setup
ScalewayCPU Instance DEV1-S2 / 2 GB≈ $7.47 (converted from the EUR list price, €6.55)€6.55 /monthModel API onlyManual setup
DigitalOceanBasic Droplet 1 vCPU / 2 GiB (s-1vcpu-2gb)1 / 2 GB$12.00≈ €10.72 (estimated conversion from $12.00) /monthOfficial templateOfficial template
HetznerCloud CPX12 (Regular Performance, shared AMD vCPU)1 / 2 GB≈ $13.67 (converted from the EUR list price, €11.99)€11.99 /monthDocumented setupManual setup
Fly.ioFly Machine shared-cpu-2x, 4 GB2 / 4 GB$25.40≈ €22.69 (estimated conversion from $25.40) /monthOfficial templateDocumented setup
Compute only, excluding tax; model API usage, storage, backups and bandwidth come on top. Framework columns show the support level the provider documents; “Model API only” means the provider serves models the agent can call, not the agent itself.Oldest price in this table:Observed Prices in USD, excluding VAT. ≈ marks a price the provider lists in EUR, converted at the ECB rate of 25 Sep 2026.≈ Estimated conversion from the listed USD price at the ECB reference rate of 23 Oct 2026 (1 EUR = 1.1193 USD). Billing currency not verified: providers may bill in USD, and your bank's rate and fees differ. Prices exclude VAT. EUR list prices are shown as the provider lists them (the dataset converts them to USD at the ECB rate of 25 Sep 2026).

Hosting is usually the smaller bill

Model usage is billed separately by the model provider, and background activity adds up. OpenClaw runs a heartbeat every 30 minutes by default (hourly with some model-provider sign-ins), and its documentation warns that heartbeats run full agent turns, so shorter intervals burn more tokens .

Budget for the renewal price, not the first term

Some VPS hosts advertise a lower introductory price for a long first term, and an always-on agent keeps running long after it ends. Plan with the price the plan renews at. Every introductory price in our dataset, next to its renewal price:

No introductory prices in the dataset

When a provider in the dataset sells a discounted first term, the offer appears here next to the price it renews at.

4. Keep the process running

On a VPS: a systemd service

systemd does not restart a service unless you ask it to: the default is Restart=no. The manual calls Restart=on-failure “the recommended choice for long-running services”, and restarts are rate-limited by StartLimitIntervalSec= and StartLimitBurst= . OpenClaw’s installer creates a user service with Restart=always and RestartSec=5 .

In Docker: a restart policy

Docker’s default policy is no. With unless-stopped, Docker restarts the container if it exits or when the daemon restarts, but not after you stopped it yourself; a policy only takes effect once the container has been up for at least 10 seconds. Pick one supervisor: Docker warns against combining restart policies with a host-level process manager such as systemd .

On Fly.io: switch off autostop for background agents

Apps created with fly launch default to auto_stop_machines = "stop" with min_machines_running = 0, so the proxy stops Machines when no requests arrive. An agent that works on its own schedule needs auto_stop_machines = "off", and Fly.io’s docs pair it with auto_start_machines = false to keep Machines running continuously .

Whichever you use, add an external check that alerts you when the agent stops answering or its last scheduled run is too old, and set a monthly budget alert at your model provider.

5. Persist state and back it up

An agent’s memory, sessions and configuration are the part you cannot rebuild from a container image. OpenClaw keeps its instructions and memory files in a workspace directory and recommends making it a private git repository; session data lives in a SQLite database under ~/.openclaw/agents/ . Its VPS guide is blunt: “Treat the VPS as the source of truth and back up the state + workspace regularly” .

Know your platform’s storage model before trusting it. On Fly.io, a Machine’s root file system is ephemeral, a volume is a slice of an NVMe drive on one physical server, Fly recommends at least two volumes per app, and its daily snapshots, kept for 5 days by default, “shouldn’t be your primary backup method” .

  • Back up off the machine, to object storage or another provider, on a schedule.
  • Encrypt backups that contain conversations or credentials.
  • Restore a backup to a fresh machine once, before you need to.
  • Keep configuration in version control, and secrets outside it.

6. Secure an agent that can act

A connected agent can act. Depending on its tool policy it “can run commands, work with files in its workspace, and message people on your behalf” . OWASP’s Top 10 for LLM applications lists prompt injection (LLM01), excessive agency (LLM06) and unbounded consumption (LLM10) among the main risks , and an always-on agent is exposed to all three.

  • Keep admin interfaces private. OpenClaw’s secure default keeps the gateway on loopback and reaches it through an SSH tunnel or Tailscale .
  • Allow-list who can talk to it. OpenClaw asks you to always set allowFrom for WhatsApp and to use a dedicated number for the assistant .
  • Sandbox tool execution. Hermes Agent recommends running its terminal in a Docker container or on a remote server .
  • Keep secrets out of the workspace. Hermes stores secrets in ~/.hermes/.env, separate from its configuration file ; on managed platforms, use the platform’s secret store.
  • Limit the blast radius. Give API keys the narrowest scope, set spending limits at the model provider, keep SSH on keys only and apply security updates.

7. Launch checklist

  1. Decide where the model runs: a hosted API (CPU server) or your own model (GPU). The Agent Hosting Selector walks through the choice.
  2. Pick a region by where your data may live and where your users and channels are.
  3. Provision at least 2 GB of RAM for an API-backed agent, with swap and SSD storage.
  4. Install it as a service with a restart policy, then reboot once to prove it comes back.
  5. Put state on persistent storage, schedule off-machine backups and test a restore.
  6. Close the admin port, allow-list senders, sandbox tools and move secrets into a secret store.
  7. Add uptime checks, log retention and model-spend alerts.

Providers with documented support for OpenClaw and Hermes Agent are compared on OpenClaw hosting and Hermes Agent hosting.

Next steps

Sources

Factual statements about providers, models, software and law link to these sources: primary sources first (official pricing pages, documentation, model cards and legal texts), third-party sources only where necessary and clearly labelled. Prices and specifications in the tables come from the AIHostCompare dataset; each provider's own sources and verification times are listed on its provider page, and the methodology explains how we verify data. Recommendations and rules of thumb are our editorial judgment.

  1. Personal assistant setup (opens in a new tab)

    OpenClaw · Official documentation · docs.openclaw.ai · accessed

    ↩
  2. Hermes Agent documentation (opens in a new tab)

    Nous Research · Official documentation · hermes-agent.nousresearch.com · accessed

    ↩
  3. Hermes Agent quickstart (opens in a new tab)

    Nous Research · Official documentation · hermes-agent.nousresearch.com · accessed

    ↩
  4. Run OpenClaw on DigitalOcean (opens in a new tab)

    OpenClaw · Official documentation · docs.openclaw.ai · accessed

    ↩
  5. Linux server: run the OpenClaw Gateway on a VPS (opens in a new tab)

    OpenClaw · Official documentation · docs.openclaw.ai · accessed

    ↩
  6. systemd.service(5): Restart= and RestartSec= (opens in a new tab)

    systemd project (man7.org Linux manual pages) · Official documentation · man7.org · accessed

    ↩
  7. Start containers automatically (restart policies) (opens in a new tab)

    Docker · Official documentation · docs.docker.com · accessed

    ↩
  8. Autostop/autostart Machines (opens in a new tab)

    Fly.io · Official documentation · docs.fly.io · accessed

    ↩
  9. Fly Volumes overview (opens in a new tab)

    Fly.io · Official documentation · docs.fly.io · accessed

    ↩
  10. OWASP Top 10 for LLM Applications 2025 (opens in a new tab)

    OWASP Gen AI Security Project · Standard or framework · genai.owasp.org · accessed

    ↩