The argument in one line.
A cheap VPS running Codex CLI inside a tmux session turns an AI coding agent from a laptop-tethered process into a 24/7 autonomous worker you can trigger from your phone.
Read if. Skip if.
- You use Claude Code or Codex CLI and have lost task progress when your laptop closed or your Wi-Fi dropped.
- You want to run overnight or multi-hour coding tasks without leaving your computer on.
- You know how to SSH into a server but have not yet wired up tmux with an AI coding agent.
- You want daily automated repo tasks — PR reviews, changelog generation, README updates — running on a schedule.
- You already run headless agents in the cloud — this is a beginner-to-intermediate walkthrough, not an advanced production setup.
- You want a code-only guide; roughly half the runtime is narrated Hostinger dashboard screen capture in a sponsored segment.
The full version, fast.
Running a coding agent on your laptop means every closed lid or dead battery kills the task. The fix is a cheap VPS running Codex CLI inside a named tmux session, which keeps running even when the SSH connection drops. Once the server is up, you SSH from your phone using Termius, attach to the tmux session, and prompt Codex normally. Cron jobs — written by asking Codex itself — schedule repeating tasks like daily PR reviews, changelog generation, or README updates, all running autonomously without your laptop ever needing to be open.
Chat with this breakdown — free.
Sign in and you get 23 free chat messages on us — ask for the hook, quote a framework, find the exact transcript moment, generate a markdown action plan. Bring your own key when you want unlimited.
Create a free account →Where the time goes.

01 · Overview
Hook: half-open laptop as relatable proxy for the problem. Solution teased.

02 · What You'll Learn
Three deliverables: spin up VPS, install Codex CLI, control from phone.

03 · Why Codex CLI
Benchmark slide: 78.2% terminal score, ~30% fewer turns, cheaper than Claude Code.

04 · The VPS Architecture
Mental model: delegate long-running tasks to VPS, do active short-turn work locally.

05 · VPS Setup
Hostinger KVM2 provisioning with one-click Codex deployment. Sponsored segment with discount code.

06 · Connecting to the Server
SSH into VPS from local terminal, find IP address, verify root login.

07 · Installing Codex CLI
curl install command if not pre-installed, device-code sign-in via ChatGPT subscription, test with hello world.

08 · Connecting GitHub
Fine-grained PAT creation (admin/contents/pull_requests scopes), apt install gh, gh auth login, verify with Codex repo-list prompt.

09 · tmux Setup
Install tmux, create named session (tmux new -s codex), disconnect demo, tmux ls, tmux attach -t codex. Explains why this is the whole point.

10 · Triggering from Phone
Termius iOS app setup, add host with IP/root credentials, attach to tmux session, type Codex prompts from mobile, demo PR review.

11 · Setting up Automations
Cron jobs via codex exec — prompt Codex to write a daily PR-review cron outputting a markdown status file. Dry run shown. Wrap-up.
Lines worth screenshotting.
- A $5/month VPS turns Codex CLI from a laptop-dependent tool into a 24/7 autonomous coding agent.
- tmux is the single piece of infrastructure that makes headless agents survive disconnects — without it, closing the SSH session kills the task.
- Codex CLI leads the terminal benchmark at 78.2% vs Claude Opus 4.8 at 74.6%, and finishes the same agentic tasks in roughly 30% fewer turns.
- codex exec is the non-interactive mode: no session UI, just fire and forget — exactly what cron jobs require.
- GitHub fine-grained tokens let you scope an agent's repo access precisely — start read-only on pull requests before expanding permissions.
- Running agents on a VPS grants data center internet speeds, dramatically faster than home Wi-Fi for large downloads or dataset fetches.
- You can trigger any automation by asking Codex to write the cron job itself — the agent sets up its own recurring schedule.
- The VPS is an isolated environment: if the agent makes a damaging mistake, you shut it down without touching your own machine.
- Codex CLI can be authenticated via device code using an existing ChatGPT Plus/Pro subscription — no separate API key needed for most use cases.
- PR review, changelog generation, and README updates are all valid daily cron candidates once this VPS setup is in place.
What headless agents actually need to run around the clock.
Persistent agent execution is not a cloud service you buy — it is three cheap pieces of open infrastructure you wire together yourself.
- A VPS gives an AI agent the three things a laptop cannot: it never sleeps, its connection does not drop, and it keeps running when the lid closes.
- tmux is the missing link — without a named persistent session, closing an SSH connection kills any running task no matter how far along it is.
- codex exec is the non-interactive flag that makes automation possible: it runs a single prompted task and exits, exactly what cron jobs require.
- GitHub fine-grained tokens let you scope an agent's repo access precisely — start read-only on pull requests before granting write permissions.
- Asking the agent itself to write the cron job is the fastest path: it knows the correct codex exec invocation and handles crontab syntax without manual guessing.
- Mobile SSH plus tmux attach turns your VPS into a phone-triggered remote compute node — start a task at the airport, check results at the hotel.
Terms worth knowing.
- VPS (Virtual Private Server)
- A rented remote Linux machine that runs 24/7 with a hardwired connection, used here as a persistent compute host for long-running AI agent tasks.
- tmux
- A terminal multiplexer that keeps shell sessions alive on the server after you disconnect, so tasks keep running when the SSH connection closes.
- Codex CLI
- OpenAI's command-line coding agent, capable of reading repos, making commits, reviewing PRs, and running shell commands autonomously.
- codex exec
- A non-interactive flag for Codex CLI that runs a single prompted task and exits — the mode needed for cron job automation.
- cron job
- A scheduled task on a Linux server defined in a crontab file; it runs a command automatically at a specified time interval such as daily at 2am.
- fine-grained personal access token
- A GitHub token that restricts which repos and permissions an application or agent can access, reducing risk if the token is exposed.
- gh (GitHub CLI)
- The official GitHub command-line tool; installed on the VPS so Codex can run GitHub operations like listing repos, reviewing PRs, and creating branches.
- Termius
- A free iOS/Android SSH client app that lets you connect to a remote server and run terminal commands from your phone.
Things they pointed at.
Lines you could clip.
“You can actually trigger a task to run from your phone. But the important part is that if that screen closes, your task is going to keep running.”
“If you want something that's gonna take a long time to run, you just delegate it to VPS, and you don't rely on you having a computer open.”
Word for word.
Don't just watch it. Burn it in.
See every word as it's spoken — crank it to 2× and still catch all of it. The same dual-channel trick behind Amazon's Kindle + Audible.
The bait, then the rug-pull.
There is a specific kind of programmer embarrassment that comes from walking through an airport with a laptop screen cracked at 30 degrees, pretending to check your bag while actually waiting for a coding agent to finish. This video is the fix: a 24-minute guide to moving that agent off your laptop and onto a server that never closes its lid.
Named ideas worth stealing.
Three Reasons a VPS Works for Agents
- Never goes to sleep (always-on hardwired connection)
- You keep all the data (self-hosted, private)
- Data center speeds (faster than home broadband)
The case for delegating long-running agent tasks to a VPS instead of running them locally.
Local vs VPS Task Split
- Local: active, turn-by-turn work where you watch the output
- VPS: long-running tasks (8+ hr), scheduled automations, anything running while you sleep
A simple mental model for when to use each compute environment.
How they asked for the click.
“So that's it, guys. I'm gonna wrap up the video here. If you enjoyed, make sure you leave a like, subscribe to the channel.”
Standard end-screen CTA. Newsletter link in description. Hostinger sponsorship woven into the tutorial mid-section.





































































