AI Agent on a VPS vs Your Own PC: Costs and Differences

Published on

Claude Code, Codex CLI or OpenClaw on your own PC or a VPS: what sleep, power at €0.2832 per kWh, security, phone access and plan limits mean, with prices.

A laptop almost closed on a dark table, with orange and blue light from the screen falling on the keyboard

You give Claude Code, Codex CLI or OpenClaw a long task, close your laptop and go to bed. In the morning the task is where you left it: the laptop slept, and the agent with it. You can keep the PC awake, but then it burns power all night, and the agent works inside the account that holds your own files. Or you pay for a VPS. Here is what really differs, with the power math and a dated cost example.

Quick answer: An agent only works while its machine is awake. On your own PC, sleep or a closed lid stops it, so overnight runs mean switching sleep off and paying for the power. On a VPS it keeps going with your laptop shut, you can follow it from your phone, and its commands stay away from your personal files. What stays the same: the model runs at the provider, and your plan's usage limits apply wherever the agent runs. At the EU average household price of €0.2832 per kWh, a PC that draws more than about 24.5 W around the clock costs more in electricity than a 4 GB VPS at €4.99 a month (as of 30 October 2026). A Mac mini idling at 4 W costs about €0.82 a month.

What Stays the Same Wherever the Agent Runs

With a hosted model, the answers come from the provider's servers either way, so neither machine needs a GPU; our GPU guide explains why. The limits belong to your account, not to the machine:

  • Claude Code: Pro and Max have "a five-hour session limit and a weekly limit", shared across Claude and Claude Code (help article). Ultra has a weekly limit, with no five-hour limit for verified accounts.
  • Codex CLI: OpenAI's pricing page estimates local messages per five-hour period for Plus and Standard Business, says weekly limits may also apply, and lists no five-hour limit for Pro at the moment.
  • API keys are billed per use on either machine. With ANTHROPIC_API_KEY set, Claude Code uses the key instead of your plan, "resulting in API usage charges"; Codex bills extra local chats on a key "at standard API rates".
  • OpenClaw signs in with an API key or a subscription, so the provider's quota applies there too.

Sleep Stops the Agent on Your Own PC

When a computer suspends, "execution of the OS is paused", as the systemd-sleep.conf manual puts it. The agent pauses with everything else:

  • Claude Code's Remote Control makes your phone "a window into that local session, so your computer has to stay on and the claude process has to keep running." After sleep, it reconnects once the machine is back online.
  • OpenAI's remote connections page says remote access stops when the host "sleeps, loses network access, or closes the app". A Mac laptop can stay reachable with the lid open and power connected; with the lid closed, it needs an external display as well.
  • OpenClaw's hosting FAQ on a laptop Gateway: "sleep/network drops disconnect it, OS updates/reboots interrupt it, must stay awake."

On Windows 11 the sleep timer sits under Settings > System > Power & battery > Screen, sleep & hibernate timeouts; Microsoft's power settings article lists newer defaults that put a plugged-in PC to sleep after 5 minutes on modern standby devices and 15 on S3 devices. On a Mac laptop, turn on "Prevent automatic sleeping on power adapter when the display is off" under System Settings > Battery > Options, or the matching switch under Energy on a Mac desktop (Apple's guide). On Ubuntu 24.04 or Debian 12, a drop-in file turns suspend and hibernation off, as the Debian wiki describes:

sudo mkdir -p /etc/systemd/sleep.conf.d
sudo tee /etc/systemd/sleep.conf.d/nosuspend.conf > /dev/null <<'EOF'
[Sleep]
AllowSuspend=no
AllowHibernation=no
EOF

Per the manual, this also rules out hybrid sleep and suspend-then-hibernate. To undo it, run sudo rm /etc/systemd/sleep.conf.d/nosuspend.conf.

A VPS has no lid to close. Over SSH you run Claude Code or Codex in tmux and OpenClaw's Gateway as a service, then shut your laptop; our guides for Claude Code, Codex CLI and OpenClaw show how. Claude's desktop app can also run Claude Code on a VPS over SSH, but with a Claude account its desktop docs say "don't count on a task to run overnight": the task's sign-in is renewed only while Desktop runs and stays connected. Run the CLI on the server in tmux instead.

Power Use: The Math With Your Own Numbers

The formula: watts × hours ÷ 1,000 = kWh, times your price per kWh. A 30-day month has 720 hours.

For the price we use Eurostat's EU average for households in the first half of 2026: €0.2832 per kWh, taxes included, for medium-sized consumers using 2,500 to 5,000 kWh a year. The same article runs from €0.1139 per kWh in Hungary to €0.3871 in Ireland, so use the price on your bill.

For the wattage, measure with a plug-in energy meter at the socket while the agent works with the screen off. Apple's Mac mini figures are taken the same way, "measured from the wall power source": 4 W at idle for both the M6 and the 2024 M4 model. While the agent waits for the model's reply, the PC sits near idle; builds and test runs push it higher.

Draw around the clockkWh in 30 daysCost at €0.2832 per kWh
4 W (Mac mini idle, Apple's figure)2.88€0.82
15 W10.8€3.06
25 W18€5.10
60 W43.2€12.23
100 W72€20.39

The other rows are examples, not typical values.

The break-even with a VPS: €4.99 ÷ €0.2832 = 17.62 kWh a month, and 17.62 kWh ÷ 720 hours = 24.5 W. Above 24.5 W around the clock, the PC costs more in power than the €4.99 VPS-S in the cost example below. At Germany's €0.3618 per kWh the line drops to 19.2 W; at Hungary's €0.1139 it rises to 60.8 W.

Security: What the Agent Can Reach

At home, the agent works inside your own user account. Anthropic's security page says a Bash command you approve "can still write anywhere your user account can." Claude Code's sandbox is off by default, and even when it is on, sandboxed commands can read "most of the machine, including credential files such as ~/.ssh and ~/.aws/credentials" and inherit the secrets in Claude Code's environment. Codex's local sandbox keeps network access off and limits writes to the workspace by default, but commands it allows can still "read accessible files."

On your own PC, those files include your browser profile, documents and keys. On a VPS, only what you put there. Anthropic's page on sandbox environments calls a dedicated virtual machine "the strongest separation, with its own kernel" and suggests one for work on an untrusted repository; a KVM VPS is such a machine. OpenClaw's FAQ recommends a dedicated host "for reliability and isolation."

A server still needs care: keys and tokens on it are as exposed as at home. Our guide to securing an AI agent on a VPS sets up a user without sudo, firewall rules and logs.

Reaching the Agent From Your Phone

  • Claude Code: Remote Control connects claude.ai/code and the Claude app to your session on Pro, Max, Ultra, Team and Enterprise plans; "API keys are not supported." On a remote machine, the docs say to start claude inside tmux or screen, and the session makes "outbound HTTPS requests only and never opens inbound ports." The VPS stays on instead of your laptop.
  • Codex: phone access goes through the ChatGPT desktop app on a Mac or Windows host that is "awake, online, and signed in". An SSH host such as a VPS sits behind it ("your phone still connects to the same host"), so your computer must stay awake, which the app has a setting for. Or SSH into the VPS from your phone and attach to tmux.
  • OpenClaw: you talk to it in chat apps, and its FAQ says WhatsApp, Telegram, Slack, Mattermost and Discord "all work fine from a VPS". On a laptop, sleep disconnects the Gateway, so a server helps most here.

What You Give Up on a VPS

In OpenClaw's FAQ, a laptop has "no server cost, direct access to local files, a live browser window"; a VPS is "often headless (use screenshots), remote file access only, SSH needed for updates." For coding agents, the code lives on the server, so you move work through Git or edit over SSH, and a desktop may have more cores of its own than a small VPS with shared vCores.

A Dated Cost Example

One coding agent works 8 hours a night on a desktop that would otherwise be off, drawing 60 W while it works (an example; use your own reading). On the VPS side are Space-Node's prices as of 30 October 2026, VAT included: the Standard VPS-S (3 vCores, 4 GB RAM, 60 GB NVMe) costs €4.99 a month or €53.89 for a year, and the VPS-M with 8 GB, the size Codex recommends (install docs), €8.99 a month. The Premium VPS-XS with 2 GB, at €4.20 a month, meets OpenClaw's 2 GB recommendation but not the 4 GB minimum of Claude Code (setup) and Codex.

Option (electricity at €0.2832 per kWh)A month (30 days)A year (365 days)
Desktop at 60 W, 8 hours a night€4.08€49.62
Desktop at 60 W, around the clock€12.23€148.85
Mac mini at 4 W idle, around the clock€0.82€9.92
VPS-S with 4 GB€4.99€59.88 paid monthly, €53.89 paid yearly
  • Overnight runs on the 60 W desktop cost about the same as the VPS-S: €49.62 against €53.89 a year. For that money, the VPS lets your PC sleep and keeps the agent away from your files.
  • An always-on agent, such as an OpenClaw gateway that answers in your chats, makes the desktop expensive: €148.85 a year against €53.89.
  • A Mac mini idling at 4 W costs less to run than any plan above. If you already own one, electricity is no reason to move; separation is the question.

Which One Fits

  • Your own PC when you work next to the agent: you watch it, approve its steps and want your local files, your editor and a visible browser. Let the PC sleep when you stop.
  • An always-on machine at home, such as a Mac mini, for the lowest power cost around the clock, as long as it holds nothing else you need to protect.
  • A VPS when the agent should keep working with your laptop shut, stay reachable through Remote Control or a chat app while your PC is off, or run its commands away from your personal files. Space-Node's VPS plans are KVM servers with full root access and dedicated RAM in an EU data center; the AI agent VPS page matches plans to agents.
  • A Claude Code cloud session when your code is on GitHub and you need no services of your own next to the agent. It "keeps running after you close your laptop", counts toward your plan's limits with "no separate charge for the cloud VM", and its VM is reclaimed after a period of inactivity (cloud sessions).

FAQ

Is it cheaper to leave my PC on than to rent a VPS? At the EU average of €0.2832 per kWh, a machine that adds more than about 24.5 W around the clock costs more than the €4.99 VPS in the example above; a Mac mini idling at 4 W costs €0.82 a month, a 60 W desktop €12.23. Measure with a plug-in meter and use the price on your bill.

Does a VPS give me more Claude or Codex usage? No. The five-hour and weekly limits belong to your plan, and API keys are billed per use wherever the agent runs.

Does the agent keep working when my laptop sleeps? Not on the laptop: a suspended computer pauses every program. Claude Code's Remote Control reconnects once the machine is back online, and Codex's remote access stops until the computer is available again. On a VPS, inside tmux, the agent carries on.

Can I keep my files on my laptop and run the agent on a VPS? Through Git: push your branch, let the agent work in a clone on the server and pull the result. The ChatGPT desktop app can hand off a Codex chat with its Git state to a connected remote host and back, and OpenClaw can pair your laptop as a node for local screen, camera and exec tools while the Gateway runs on the server.

Sources

All opened on 31 October 2026:

Claude Code, Codex CLI and OpenClaw belong to their makers. Space-Node is not affiliated with or endorsed by any of them.