Skip to content

AS213941 · Peering-20% on all VPS with code NVH20 · Delivered in 60 seconds

Linux VPSFrom 2,49 €/monthWindows VPSFrom 3,49 €/monthFiveM serverFrom 0,99 €/monthMinecraft serverFrom 1,99 €/month
VPS & Cloud

Ranges

Linux NVMe VPSRoot access, Debian, Ubuntu, Alma…Windows RDP VPSRemote desktop, licence includedDedicated serversIntel Xeon Gold, exclusive resourcesPterodactyl VPSGame panel preinstalled

Network and hosting

Anti-DDoSWeb hostingColocationIP transitVPN

Professionals

Reseller VPSReseller programme
Solutions

Bots and automation

AI agents VPSA server for your coding assistants and autonomous agentsTelegram bot VPSPython or Node.js, always reachableDiscord bot VPSMusic, moderation, tickets: no downtimen8n VPSWorkflows with no execution limitVPN VPSAn encrypted tunnel exiting in FranceWeb scraping VPSScheduled data collection, dedicated IP

Trading

Forex VPSYour robots manage positions overnightMetaTrader 4 VPSSeveral MT4 terminals on one machineMetaTrader 5 VPSForex, indices and stocks in MT5NinjaTrader VPSFutures and NinjaScript strategiesTrading bot VPSOpen-source crypto bots, protected API keys

Windows desktop

Windows 10 VPSFor software that requires Windows 10Windows 11 VPSA modern Windows desktop, reachable anywhereSEO VPSLarge-site crawls without tying up your PCStreaming VPSAn OBS studio streaming from the data centreWordPress VPSFast websites on NVMe disks
Marketplace

Intelligence artificielle

Claude CodeL'agent de code d'Anthropic, dans votre terminalCodex CLIL'agent de code d'OpenAI en ligne de commandeOllamaDes modèles de langage locaux, sans API externeOpen WebUIUne interface de discussion pour vos modèles Ollama

Automatisation

n8nVos automatisations, sans limite d'exécutions

Déploiement et conteneurs

DockerLe moteur de conteneurs et Docker ComposeCoolifyDéployez vos applications depuis Git, sur votre serveurPortainerGérez vos conteneurs Docker depuis le navigateur

Supervision

Uptime KumaSurveillez vos sites et serveurs, alertes comprises

Network and security

WireGuardVotre propre VPN chiffré, rapide et moderneVaultwardenUn gestionnaire de mots de passe auto-hébergé

Sites et cloud

NextcloudVotre cloud de fichiers, agenda et contactsWordPressLe CMS le plus utilisé, sur une pile Nginx rapide

Jeux

PterodactylLe panel pour héberger vos serveurs de jeux
Gaming

Game servers

FiveM servertxAdmin, ESX, QBCoreMinecraft serverJava, Bedrock, modpacksRust serverOxide, Carbon, wipesNova-Life serverNova-Life: Amboise RP

Protection and tools

FiveM Anti-DDoSFree tools
Resources

Learn

DocumentationBlog

Assistance

ContactSLA commitment
View plans Client area Peering · AS213941

AI · Tutorial · 10 min

Running Claude Code or Codex on a VPS: the complete guide

By the NVHCloud team · 31 Oct 2026 · 10 min read

Coding agents such as Anthropic's Claude Code and OpenAI's Codex CLI read a project, edit files and run commands from the terminal. Installing them on a VPS rather than your own computer has three advantages: the session keeps going when you close your laptop, the agent works in an environment isolated from your personal files, and you can reach it over SSH from any device. This guide installs both tools on a Linux VPS and sets up a clean, safe environment.

1. Why a VPS for a coding agent

CriterionOn your computerOn a VPS
Long task (refactor, migration, tests)Stops when you close the computerContinues inside a tmux session
Access to your personal filesThe agent works on your machineIsolated: only the repositories cloned on the server
Access from several devicesNoYes, over SSH from a PC, a Mac or a phone
Linux environment matching productionDepends on your systemYes
Starting over after a mistakeTrickyReinstall the server in a few minutes
💡 The model does not run on the VPS: Claude Code and Codex call Anthropic's and OpenAI's APIs. The server needs neither a graphics card nor much memory.

2. Preparing the server

Start from a Linux VPS running Ubuntu 24.04 and secure it first: personal user, SSH key, firewall. See first steps on your VPS. Then create a user dedicated to the agent, without root rights:

adduser --disabled-password --gecos "" agent
apt update && apt install -y git tmux curl build-essential
su - agent

Working with a user that has no admin rights limits what the agent can change on the system, even if a command goes wrong.

3. Installing Claude Code

curl -fsSL https://claude.ai/install.sh | bash
claude

On first launch, Claude Code offers to sign in with your Claude account or an Anthropic API key. On a server without a browser, it shows a URL to open on your computer to confirm the sign-in. Then move into a project folder and run claude.

4. Installing Codex CLI

Codex CLI installs with npm, so you need Node.js. Install the LTS version as root, then the tool:

curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
apt install -y nodejs
npm install -g @openai/codex
su - agent
codex

Codex signs in with your ChatGPT account or an OpenAI API key. Both agents can live side by side on the same server.

5. Keeping the session open with tmux

Without precautions, the agent stops as soon as the SSH connection drops. tmux keeps the session alive on the server:

tmux new -s agent          # create a session named "agent"
claude                     # or codex, inside the project folder
# Ctrl+B then D to detach: the agent keeps working
tmux attach -t agent       # to come back later, from any device

You can open several windows in the same session (Ctrl+B then C): one for the agent, one to watch tests or logs.

6. Secure Git access

The agent needs to clone and push code. Do not give it your personal SSH key:

  • One deploy key per repository: create a dedicated key on the server (ssh-keygen -t ed25519 -f ~/.ssh/repo) and add it as a deploy key for that repository only.
  • Or a narrowly scoped token: an access token restricted to one repository and the rights it needs, with an expiry date.
  • A working branch: let the agent work on a branch, and review before merging.

7. Security rules to follow

  • No production secrets on the agent's server: use test databases and test keys.
  • Review the commands it proposes before allowing them, at least while you are getting to know the tool. Both agents ask for confirmation before running a command or editing a file, depending on the mode you choose.
  • API keys in environment variables, with limited rights and a spending cap at the provider.
  • Updates: rerun the Claude Code installer or npm update -g @openai/codex regularly, and keep the system updated.
  • Backups: if the agent works on files not yet pushed, back them up. See backups with Borg.

8. Which configuration to choose

UseRAMvCPU
One agent, small projects, scripts2 GB2
Web projects with Node.js or Python dependencies, tests4 to 8 GB2 to 4
Several agents in parallel, builds, Docker containers8 to 16 GB4 to 6

It is not the agent that consumes resources, but what it launches: installing dependencies, compiling, test suites, containers. NVMe storage speeds these up noticeably. Plans are on the NVMe VPS page.

9. The total cost

It has two distinct parts:

  • The server: the VPS price, fixed each month.
  • The model: your Claude or ChatGPT subscription, or your API key usage, billed by Anthropic or OpenAI according to consumption.

With an API key, set a monthly spending cap in the provider's console: an agent running for a long time on a large project can consume a lot.

10. A typical working day

Here is how working with an agent on a remote server is organised in practice:

  1. In the morning, from your computer: ssh agent@VPS_IP, then tmux attach -t agent. You find the session exactly where you left it.
  2. You describe a precise task: "add pagination to the orders API and write the matching tests". The more concrete the instruction, the more reliable the result.
  3. The agent reads the project, proposes a plan, edits files and runs the tests. You approve commands as they come, or let it work more autonomously on a dedicated branch.
  4. You detach with Ctrl+B then D during a long task, such as a dependency migration, and come back later, even from your phone with an SSH app.
  5. You review the branch with git diff or in your forge's interface, then merge.

To go faster, add an instructions file at the root of each project (for example CLAUDE.md for Claude Code or AGENTS.md for Codex) describing the test commands, coding conventions and what the agent must never touch. The agent rereads it at every session.

11. Going further: autonomous agents and notifications

A VPS also lets you run agents that work without you, for example to triage tickets, watch a repository or prepare a report every morning:

  • Scheduled tasks: a script started by cron that calls the agent non-interactively on a precise task, then saves the result.
  • Notifications: when a task ends, a message sent to Telegram or Discord with a simple HTTP call.
  • Automations: n8n can trigger the agent from a form, an email or a webhook.

In every case, keep the same caution: limited rights, test keys, human review before anything goes to production.

Frequently asked questions

Do Claude Code or Codex need a graphics card?

No. The models run at Anthropic and OpenAI; the server only runs the command-line tool and the commands it launches. A standard VPS is enough.

Does Claude Code work without a browser on a server?

Yes. On first launch, it shows a URL to open on another device to confirm the sign-in, or you can use an Anthropic API key.

How do I get back to a session after closing my computer?

Start the agent inside tmux, detach with Ctrl+B then D, and come back later with tmux attach from any device connected over SSH.

Can Claude Code and Codex run on the same VPS?

Yes, they install side by side. Plan for 4 GB of RAM or more if you use them in parallel on projects that compile or run tests.

Can the agent break my server?

It can run commands, hence the value of a user without root rights, reviewing its proposals and keeping no production secrets on the server. If something goes wrong, a VPS can be reinstalled in a few minutes.

Linux NVMe VPS

Root access, Intel Xeon Gold and NVMe, delivered in 60 seconds. From 2,49 €/month.