Issue 00 · Autumn 2026日本語 · RSS
AgentKoji

Running AI Coding Agents on a VPS: Choosing, Logging In, Staying Up

To run Claude Code on a VPS, check the 4 GB+ RAM requirement, outbound access, headless login, and whether a stopped server still bills, in that order. Checked 2026-11-15.

TL;DR

  • Claude Code's official requirements are Ubuntu 20.04+, Debian 10+ or Alpine Linux 3.19+ (among others), 4 GB+ RAM, an x64 or ARM64 processor and an internet connection. npm installs need Node.js 22 or later.
  • On a server without a browser, open the login URL in your local browser and paste the code it shows at the Paste code here if prompted prompt. The one-year token from claude setup-token can only make model requests.
  • A stopped VPS is not always a free VPS. Check each provider's billing rules before you sign up, and push your work before you delete a server.

To run an AI coding agent on a VPS, check four things in this order: the requirements (4 GB+ RAM and the rest), outbound network access, how you log in on a server with no browser, and whether the server keeps billing while it is stopped. This page is a map for those checks. It covers how to split by use case, tables of requirements and required hosts, the login flow, cost and recovery, and the order in which to read our VPS guides.

Every fact was checked against the official docs on 2026-11-15, when the latest Claude Code on npm (@anthropic-ai/claude-code) was 2.1.325. We did not run any command on this page for this hub, and we did not sign up for a VPS. Where the docs did not state something, we left it out or marked it “unverified”. We give no prices, because they change.

Split by use case

The same VPS needs different checks depending on how you use it.

UseHow it runsCheck firstRead next
You SSH in and work interactivelySSH in and start claude inside tmuxRequirements, headless login, billing for idle hoursRun Claude Code on a VPS: SSH, tmux and Headless Login
An agent stays up on its ownStarted by systemd or similar, unattendedOutbound access, login expiry, monitoring, where secrets liveRun an AI Agent 24/7 on a VPS
CI or scriptsclaude -p, non-interactiveHow keys are passed, whether to use --bareClaude Code in CI, Headless and Production

How to pick the VPS itself is in Choosing a VPS for AI Coding.

Two points from the docs matter when the agent stays up:

Requirements

ItemOfficial requirement
OS (Linux)Ubuntu 20.04+, Debian 10+, Alpine Linux 3.19+
Hardware4 GB+ RAM, x64 or ARM64 processor
NetworkInternet connection required
ShellBash, Zsh and others
LocationAnthropic supported countries

Source: https://code.claude.com/docs/en/setup (checked 2026-11-15)

Start from plans with 4 GB of memory or more. Smaller plans do not meet the official requirement.

The docs do not say how much memory several parallel sessions need (unverified).

Outbound network access

If you restrict outbound traffic with a firewall or proxy, allow at least these hosts.

HostUsed for
api.anthropic.comClaude API requests
claude.aiclaude.ai account authentication
claude.comThe sign-in page opened in the browser, which redirects to claude.ai
platform.claude.comConsole authentication, plus OAuth token exchange, refresh and revocation for claude.ai accounts
downloads.claude.aiNative installer, auto-updater and update checks
registry.npmjs.orgnpm installs of Claude Code, plugin installs and npx-launched MCP servers

Source: https://code.claude.com/docs/en/network-config (checked 2026-11-15)

The official table also lists hosts such as sso.claude.com (SSO sign-in), mcp-proxy.anthropic.com (claude.ai connectors) and github.com (plugin marketplaces). Check the full table against the features you use.

Whether a given VPS lets you filter outbound traffic by host differs by provider. We did not check each provider’s firewall features (unverified).

Logging in on a server with no browser

For interactive use, the normal login is enough.

  1. Run claude on the VPS. If the browser doesn’t open, press c to copy the login URL.
  2. Open the URL in your local browser and sign in.
  3. If the browser shows a login code instead of redirecting back, paste it at the Paste code here if prompted prompt.
  4. The terminal shows Login successful when it is done.

Source: https://code.claude.com/docs/en/authentication (checked 2026-11-15)

The docs do not say whether the c copy reaches your local clipboard over SSH (unverified). On Linux, credentials are stored in ~/.claude/.credentials.json with file mode 0600. Source: https://code.claude.com/docs/en/authentication (checked 2026-11-15)

When to use claude setup-token, and its limits. It creates a one-year OAuth token for CI and scripts where browser login isn’t available.

Source: https://code.claude.com/docs/en/authentication (checked 2026-11-15)

When several credentials are present, Claude Code picks one by a fixed precedence: ANTHROPIC_API_KEY ranks above CLAUDE_CODE_OAUTH_TOKEN, and the subscription login from /login comes last. In non-interactive mode (-p), ANTHROPIC_API_KEY is always used when present. Source: https://code.claude.com/docs/en/authentication (checked 2026-11-15)

We did not try this flow on a real VPS (unverified).

Secrets and permissions

This section only points to the guides.

Cost while idle, and recovery

Hourly billing does not always mean a stopped server costs nothing. These are the two Japanese providers our VPS guides cover.

ServiceBillingWhile stoppedRecovery
ConoHa VPSHourly with a monthly cap and no minimum term, or a 1 to 36-month prepaid discountBilled per contracted server, running or stopped, up to the time you delete itFree snapshots (deleted after 24 hours), paid automatic backups (daily, up to 30 generations), saved images
XServer VPS (single server)No hourly billing listed on the official pageUnverifiedAutomatic backup column shows ”—”
XServer VPS CloudNo hourly billing listed on the official pageUnverifiedDaily automatic backups (up to 7 days)

Source: https://vps.conoha.jp/ (checked 2026-11-15) Source: https://support.conoha.jp/vps/faq/vps-q/service-q/ (checked 2026-11-15) Source: https://support.conoha.jp/v/deletevps/ (checked 2026-11-15) Source: https://vps.xserver.ne.jp/ (checked 2026-11-15)

To stop ConoHa VPS billing, delete the server; a deleted server can’t be recovered. XServer’s page suggests 2 GB for personal or test use, 4 GB for development and operation together, and 8 GB for several services. Source: https://vps.xserver.ne.jp/ (checked 2026-11-15). Claude Code needs 4 GB+, so the 2 GB plan does not meet its requirement.

For any provider, check on the official pages:

Restoring a backup or deleting a server loses the most recent work on it, so push to a remote repository often. Prices and plans change; confirm them on the official pages before you sign up. How we compare these points across providers is in Choosing a VPS for AI Coding.

Reading order

Starting points, not a ranking. New to running agents on a VPS? Read top to bottom.

  1. Choosing a VPS for AI Coding: pick a VPS by requirements, outbound access, billing and recovery.
  2. Run Claude Code on a VPS: SSH, tmux and Headless Login: SSH keys, a working user, install, headless login and keeping work alive in tmux.
  3. Run an AI Agent 24/7 on a VPS: keep an agent up with systemd and catch the “green but stalled” state.

From the neighboring pillars, also read Run Claude Code in Docker and Dev Containers (container isolation) and Keep Secrets Away from Claude Code (keeping keys out of sight).

Summary

FAQ

How much memory does a VPS need to run Claude Code?
The official requirement is 4 GB+ RAM, with an x64 or ARM64 processor, an OS such as Ubuntu 20.04+, Debian 10+ or Alpine Linux 3.19+, and an internet connection. The docs do not say how much memory parallel sessions need.
Which hosts must a VPS firewall allow for Claude Code?
api.anthropic.com, claude.ai, claude.com and platform.claude.com. The native installer and auto-updater also use downloads.claude.ai, and npm installs need registry.npmjs.org. SOCKS proxies are not supported.
How do I log in to Claude Code on a VPS without a browser?
If the browser does not open, press c to copy the login URL and open it in your local browser. If the browser shows a login code instead of redirecting back, paste it at the Paste code here if prompted prompt. On Linux, credentials are stored in ~/.claude/.credentials.json with file mode 0600.
What can't a claude setup-token token do?
It can only make model requests, so it can't establish Remote Control sessions or fetch claude.ai connectors. It requires a Pro, Max, Ultra, Team or Enterprise plan, and --bare runs do not read it.