Skip to main content
VPSGuide

Codex on a VPS: five tasks beyond your laptop

Detach from a server-side Codex session, reconnect from the train, and use tests, review, web search and scripted release notes without confusing persistence with autonomy.

4 min readSharpHeberg
Codex on a VPS: five tasks beyond your laptop

Running Codex on a VPS separates the work from the laptop displaying it. Start the agent inside tmux on your Linux server, detach before your train, and return to the same session later. A closed laptop or lost client signal need not terminate the server-side process, provided the server stays online.

The accompanying Short, with native English audio, is an animated illustration, not a real terminal test. Its five uses explain a workflow; they are not evidence of five completed jobs.

Prepare Codex on a VPS before travelling

Use a maintained Linux distribution, a dedicated non-root account, SSH keys, Git and tmux. Prepare a project checkout, dependencies and the repository's real test commands. Keep production secrets and unrelated repositories out of the agent's workspace. The VPS hosts the CLI and tools; it does not supply model inference.

Install the CLI using the official Codex installation and login instructions. Choose eligible ChatGPT access or a supported, separately billed API configuration. Do not assume that a hosting payment includes either. Finish authentication while you have a stable connection, and review repository trust and permission settings before granting access.

Connect to the server, enter your project directory, and create tmux there, not on the laptop:

bash
ssh you@your-vps
bash
tmux new -s codex
codex --search

The Codex CLI reference documents the search option. The official tmux guide covers session management. Detach by pressing Ctrl-b, releasing both keys, then pressing d. Detaching leaves the remote session running; it does not approve future actions automatically.

After reconnecting over SSH, return with:

bash
tmux attach -t codex

Read the current screen before sending another instruction. The agent may have finished, failed or paused for an approval while you were away. Save useful output and review the working tree before starting another task.

Five uses for Codex on a VPS

1. Fix a failing test and rerun the suite

Give Codex the failing command, error and expected behaviour. Ask it to reproduce the failure, explain the smallest patch and rerun the relevant tests. Allow only the necessary workspace changes. Read actual test output and exit status; successful edits alone do not establish that the suite passes or that unrelated behaviour is unchanged.

2. Review before pushing

Use /review in the interactive session before authorizing a push. Define whether you want the current changes or a branch comparison reviewed. Treat findings as leads to inspect, not a security audit or guarantee of correctness. Keep repository credentials and push permission separate from the ability to read local code.

3. Search for current documentation

With search enabled, ask for the official documentation for the exact library version used by your project. Require source links and distinguish a documented API from a suggested implementation. Web results can be outdated or misleading; do not let instructions found on a page override project rules or expose secrets.

4. Continue while your client loses signal

The tunnel scene concerns the train passenger's connection. Codex can keep working because the VPS still has network access to its provider and other required services. It does not mean Codex works with an offline server. Approval prompts, exhausted provider limits, a crashed process or a server reboot can stop progress; tmux is not a job supervisor or a reboot-recovery system.

5. Draft release notes in a script

From the intended repository, the illustrated command is:

bash
codex exec "draft the release notes"

Specify the release range and audience in a real workflow so the notes do not confuse unreleased work with shipped changes. The non-interactive documentation states that this mode defaults to a read-only sandbox. Check local configuration and integrations rather than assuming every environment has identical permissions. Progress goes to standard error and the final response to standard output. That output is a draft report, not a deployment, tag or published release.

When using Codex on a VPS, make a clean Git checkpoint before edits and define a rollback path. If you return to an unexpected diff, stop the next instruction and inspect what changed. Reattaching a terminal does not validate or accept the agent's work.

A persistent workspace still needs an operator

Before leaving Codex on a VPS, inspect pending approvals and resource usage. Review changes and checks when you return. Compare SharpHeberg Linux VPS options for a server sized to builds, storage and tests. Hosting keeps the workspace separate from your laptop; it does not remove provider charges, maintenance or human approval.

Video

Watch the Short (English audio)

Related Articles

Continue exploring our knowledge base with these related articles

Published on November 30, 2026 by SharpHeberg

Thank you for reading our technical insights and tutorials

Back to Blog