HomeStart / GuidesAnleitungen / How to run Claude Code or Codex CLI on a VPS/ Wie man Claude Code oder Codex CLI auf einem VPS betreibt

How to run Claude Code or Codex CLI on a VPSWie man Claude Code oder Codex CLI auf einem VPS betreibt

Terminal coding agents like Claude Code and Codex CLI run fine on a small Linux server. A VPS keeps long sessions alive when your laptop sleeps, gives the agent a sandbox away from your personal files, and lets you reconnect from any device.Terminal-Coding-Agents wie Claude Code und Codex CLI laufen problemlos auf einem kleinen Linux-Server. Ein VPS hält lange Sitzungen am Leben, wenn Ihr Laptop schläft, gibt dem Agenten eine Sandbox fern Ihrer privaten Dateien und lässt sich von jedem Gerät wieder verbinden.

Why run a coding agent on a VPS?Warum einen Coding-Agenten auf einem VPS betreiben?

How much VPS do you need?Wie viel VPS brauchen Sie?

The agent itself is a light Node.js process; the model runs at the provider. What needs resources is your project: dependency installs, compilers, test suites and containers. Size the server for your build, not for the agent, and add swap on small plans.Der Agent selbst ist ein leichter Node.js-Prozess; das Modell läuft beim Anbieter. Ressourcen braucht Ihr Projekt: Abhängigkeitsinstallationen, Compiler, Testsuiten und Container. Dimensionieren Sie den Server für Ihren Build, nicht für den Agenten, und richten Sie auf kleinen Plänen Swap ein.

Step 1, Prepare the serverSchritt 1, Server vorbereiten

  1. Connect through SSH with a key, create a non-root user and work as that user. Never run an agent as root.Verbinden Sie sich per SSH mit Schlüssel, legen Sie einen Benutzer ohne Root-Rechte an und arbeiten Sie als dieser Benutzer. Lassen Sie einen Agenten nie als root laufen.
  2. Update the system withAktualisieren Sie das System mit sudo apt update && sudo apt upgrade.
  3. InstallInstallieren Sie git, tmux and a current LTS release of Node.js. Check each tool's documentation for its minimum Node version.und eine aktuelle LTS-Version von Node.js. Prüfen Sie in der Dokumentation des jeweiligen Tools die Mindestversion von Node.

Step 2, Install the agentSchritt 2, Agenten installieren

Both tools can sign in with a paid subscription or use an API key. On a headless server the login flow prints a link you open on another device; follow the prompt in the terminal. If you use an API key, keep it in an environment file readable only by your user, never in the repository.Beide Tools können sich mit einem bezahlten Abo anmelden oder einen API-Schlüssel nutzen. Auf einem Server ohne Bildschirm zeigt der Login einen Link, den Sie auf einem anderen Gerät öffnen; folge der Anweisung im Terminal. Nutzen Sie einen API-Schlüssel, leg ihn in eine Umgebungsdatei, die nur Ihr Benutzer lesen kann, nie ins Repository.

Step 3, Keep sessions alive with tmuxSchritt 3, Sitzungen mit tmux am Leben halten

An interactive agent needs a terminal, so a systemd service is the wrong tool here. Start a named session withEin interaktiver Agent braucht ein Terminal, deshalb ist ein systemd-Dienst hier das falsche Werkzeug. Starten Sie eine benannte Sitzung mit tmux new -s agent, run the agent inside it, detach with, starten Sie den Agenten darin, trennen Sie sich mit Ctrl-b dand come back later with und komm später zurück mit tmux attach -t agent. A tmux session survives a dropped SSH connection but not a server reboot, so commit work often.. Eine tmux-Sitzung übersteht eine abgebrochene SSH-Verbindung, aber keinen Server-Neustart, also committe oft.

Step 4, Stay safeSchritt 4, Sicher bleiben

Step 5, Know your plan limitsSchritt 5, Abo-Limits kennen

Subscription plans cap how much agent work you get per time window, and the providers change these limits often. Before you plan a long unattended session, check the current numbers in ourAbos begrenzen, wie viel Agentenarbeit Sie pro Zeitfenster bekommen, und die Anbieter ändern diese Limits oft. Bevor Sie eine lange unbeaufsichtigte Sitzung planen, prüfen Sie die aktuellen Werte in unserem AI Plan Limits TrackerKI-Abo-Limits-Tracker , which quotes the providers' own help pages and is re-checked every hour., der die Hilfeseiten der Anbieter wörtlich zitiert und stündlich neu geprüft wird.

Technical guidance is informational. Plans, specifications and final prices are listed in the shop. Managed automation and one-click app plans can be ordered directly and are provisioned automatically after payment. US locations (Dallas, TX and Charlotte, NC) are available for VPS, game server, voice and web hosting plans. Custom configurations are still arranged by e-mail.Technische Hinweise dienen der Information. Pläne, Spezifikationen und Endpreise stehen im Shop. Managed-Automation- und One-Click-App-Pläne können direkt bestellt werden und werden nach der Zahlung automatisch bereitgestellt. US-Standorte (Dallas, TX und Charlotte, NC) sind für VPS-, Gameserver-, Voice- und Webhosting-Pläne wieder bestellbar. Sonderkonfigurationen werden weiterhin per E-Mail vereinbart.

FAQ

Does the AI model run on the VPS?Läuft das KI-Modell auf dem VPS?

No. Claude Code and Codex CLI send requests to the provider; the VPS runs the client, your code and your builds.Nein. Claude Code und Codex CLI schicken Anfragen an den Anbieter; der VPS führt den Client, Ihren Code und Ihre Builds aus.

Can I use my subscription instead of an API key?Kann ich mein Abo statt eines API-Schlüssels nutzen?

Yes, both tools support signing in with a paid plan. Usage then counts against that plan's limits, which you can compare in the AI Plan Limits Tracker.Ja, beide Tools unterstützen die Anmeldung mit einem bezahlten Abo. Die Nutzung zählt dann gegen die Limits des Abos, die Sie im KI-Abo-Limits-Tracker vergleichen können.

Why tmux and not systemd?Warum tmux und nicht systemd?

These agents are interactive and expect a terminal. tmux keeps that terminal open while you are disconnected. Use systemd for unattended services such as bots.Diese Agenten sind interaktiv und erwarten ein Terminal. tmux hält dieses Terminal offen, während Sie getrennt sind. Für unbeaufsichtigte Dienste wie Bots nimm systemd.

RelatedVerwandt

AI Plan Limits TrackerKI-Abo-Limits-Tracker

Current ChatGPT and Claude plan limits, quoted from the providers.Aktuelle Limits der ChatGPT- und Claude-Abos, wörtlich von den Anbietern.

Self-host code-server on a VPScode-server selbst auf einem VPS hosten

VS Code in the browser on your own server.VS Code im Browser auf Ihrem eigenen Server.

What is a KVM VPS?Was ist ein KVM-VPS?

Why full root and your own kernel matter.Warum voller Root-Zugriff und Ihr eigener Kernel wichtig sind.

Ready to order?Bereit zu bestellen?

Prices are final totals; no VAT is shown (§19 UStG). Need something the shop does not list? Email us for a written offer.Alle Preise sind Endpreise ohne ausgewiesene USt. (§19 UStG). Sie brauchen etwas, das nicht im Shop steht? Schreiben Sie uns für ein schriftliches Angebot.

No public promotion is active.Es ist keine öffentliche Aktion aktiv.

Order now →Jetzt bestellen → Request a custom configIndividuelle Konfiguration anfragen
Try the free toolProbieren Sie das kostenlose Tool
AI Plan Limits Tracker →KI-Abo-Limits-Tracker →