Codex over SSH: Run Codex on a Remote Server or VPS

Codex over SSH: Run Codex on a Remote Server or VPS — How to run Codex over SSH on a VPS or remote server: the setup, where keys and secrets live, Tailscale access, and keeping sessions alive without losing the simple desktop workflow.
May 23, 20264 mins read
Share with

Most Codex work starts on a laptop. The problem is that the work rarely stays laptop-shaped. A serious refactor wants a stable network, a clean checkout, a persistent shell, and enough time to finish after you close the lid.

Our answer is simple: keep the agent on a VPS, reach it over Tailscale, and treat SSH as the control plane rather than the place where everything has to be manually operated.

Codex running on a VPS while the laptop stays a thin control surface

Why SSH Still Matters

SSH is not the product experience we want people to live in forever. Office Claws gives each agent a desk in the pixel office so you can see who is running, who is idle, and who needs attention. But under that friendly surface, SSH remains the boring primitive that works.

It gives us three useful properties:

NeedWhat SSH gives usWhy it matters for Codex
ReachabilityA stable path to the VPS over TailscaleThe laptop can move networks without exposing the agent publicly
RecoveryA way back into tmux, logs, and the repoLong tasks survive disconnects
DebuggingDirect access when the UI is not enoughWe can inspect files, processes, and tests without guessing

That is the shape we like: pixel office for daily control, SSH for the rare moment when you need a wrench.

Run your first agent in about 3 minutes

Install the Office Claws CLI, connect your Contabo account and Codex subscription, and your agent gets its own VPS and a desk in the office.

curl -fsSL https://officeclaws.com/downloads/install.sh | sh

$4.99/mo + your own Contabo VPS · keys stay in your keychain

The Remote Workflow We Use

A good remote Codex setup has a narrow path from laptop to agent:

# connect over the private Tailnet, not the public internet
ssh office-claws-agent
 
# keep the Codex task alive if the connection drops
tmux new -s feature-work
 
# run Codex inside the repo on the VPS
cd ~/work/project
codex "implement the settings export flow, then run npm test"

The important part is not the exact command. It is where state lives. The repo, terminal session, logs, and Codex context stay on the VPS. The laptop is only a window into that state.

In Office Claws, you bring Contabo API credentials and a Tailscale auth key during officeclaws onboard. We provision the VPS from a pre-baked image in your own Contabo account, attach it to the Tailnet, and make it show up in the desktop app, usually in about 2–3 minutes.

Keep Secrets Local to the Right Boundary

The fastest way to make a remote agent scary is to scatter credentials across laptops, VPSs, and chat prompts. We try to keep the boundary boring:

Credential boundary between laptop, Tailscale, VPS, and Codex session

  • Your laptop keeps the Office Claws account session and app-level controls
  • Tailscale carries encrypted traffic between the laptop and the agent
  • The VPS keeps only the credentials it needs to run the agent workflow
  • Codex runs inside that VPS context, not inside a random public shell

This is also why we prefer one agent per VPS. If a task goes sideways, the blast radius is a small machine with one job. You can stop it, inspect it, rebuild it from a snapshot, or delete it entirely.

When to Use SSH, and When Not To

SSH is perfect for setup, recovery, and heavy technical work. It is not the best interface for every interaction.

Use SSH forUse the desktop app for
Attaching to a long tmux sessionSeeing which agents are active
Running a test suite manuallySwitching between agent conversations
Inspecting logs or disk usageStarting normal chat-driven tasks
Emergency recoveryMonitoring multiple agents at once

If you are in SSH all day, the product has failed you. If SSH is unavailable when something breaks, the infrastructure has failed you. We want neither.

Recommendations

Start with one remote Codex agent before building a fleet. Put it on a small VPS, join it to Tailscale, and run every long task inside tmux. Once that feels boring, add a second agent for review or background work.

If you do not want to wire up the VPS path by hand, let Office Claws provision it for you. The plan is $4.99/month for your first agent, and the VPS itself runs in your own Contabo account, billed by Contabo directly.

Related reading:

Author

Office Claws Team

Building the future of AI agent management at Office Claws. Sharing insights on infrastructure, security, and developer experience.

Run your first agent in about 3 minutes

Install the Office Claws CLI, connect your Contabo account and Codex subscription, and your agent gets its own VPS and a desk in the office.

curl -fsSL https://officeclaws.com/downloads/install.sh | sh

$4.99/mo + your own Contabo VPS · keys stay in your keychain