How to control Codex on a Linux server from your phone
Every working way to drive a Codex session on a headless Linux box from your phone in 2026: OpenAI's Remote, the codex remote-control CLI path, SSH with tmux, and a companion app. What each needs and where each breaks.
- CLI
- 0.2.15
- Preview ref
- b8d1c44
TL;DR
There are four ways to reach a Codex session on a headless Linux box from your phone. They differ in one question: what has to be running besides the Linux box?
- OpenAI's Remote (official, supported): a Mac or Windows PC runs the ChatGPT desktop app, connects to your Linux box over SSH, and your phone pairs with that PC. The Linux box does the work, but the Mac or PC has to stay awake.
codex remote-controlon the Linux box itself: documented as a CLI command, and people report it working with ChatGPT mobile. OpenAI's Remote connections page still says mobile setup starts from the desktop app, so treat this path as unofficial and expect changes.- SSH + tmux (or mosh) from a phone terminal app: nothing extra on the server, full control, painful for reading diffs and answering approvals on a small screen.
- A companion app that runs on the Linux box: for example Happier (I maintain it). The box becomes a machine you start Codex sessions on directly, and with Codex CLI 0.131.0+ the native Codex TUI and the phone are on the same thread.
If you already have a Mac that is always on, option 1 is the simplest supported answer. If the Linux box is the only always-on computer you have, read on.
The problem
My long Codex runs live on a Linux box in a closet. It never sleeps, it has the repos, and it has the right toolchains. My laptop does sleep, constantly.
So the question I kept typing into search was some version of "Codex remote control on a Linux server", and the answers I found were a mix of "it's not supported", "it works, here are the commands" and "it worked for ten minutes and then my phone showed the welcome screen again". All three turn out to be true, depending on which path you take.
This guide lays out each path with what it needs, what it gives you, and the failure modes people actually report.
Option 1: OpenAI's Remote, with a Mac or Windows PC in the middle
This is the supported route. As of 2026-10-11, OpenAI's Remote connections page says:
- Remote access "supports hosts running the ChatGPT desktop app on macOS and Windows".
- "Mobile setup starts from the app; you can't set it up from the Codex CLI or IDE extension."
- A Linux machine fits in as an SSH host: the desktop app reads concrete host aliases from
~/.ssh/config, starts the remote Codex app server over SSH, and runs chats against the remote filesystem.codexmust be on the remote user'sPATH. - In a ChatGPT workspace, "your admin may need to enable Remote Control access".
What that means in practice:
- Good: first-party, polished phone UI, approvals and diffs on the phone, and the work really runs on the Linux box.
- Catch: the Mac or Windows PC running the desktop app is in the chain. If it sleeps, loses network or closes the app, remote access stops. OpenAI's own guidance is to keep that host plugged in and awake.
If you have an always-on Mac mini anyway, stop here. This is the least-moving-parts answer.
Option 2: codex remote-control directly on the Linux box
OpenAI's developer commands reference documents:
codex remote-control # run in the foreground
codex remote-control start # start the local app-server daemon with remote control enabled
codex remote-control pair # print a short-lived manual pairing code
codex remote-control stopYou enter the pairing code in the ChatGPT mobile app. Users in r/codex report this working on headless Linux, with two requirements they hit repeatedly: you need ChatGPT sign-in, not an API key (the error quoted in the thread is "remote control requires ChatGPT authentication"), and one commenter says the npm build did not work for them while the install script build did.
What people report going wrong (Reddit, July to September 2026; your mileage will differ by version):
- The phone connects, then a few minutes later shows the welcome screen asking you to connect a Mac app.
- You can see session history, but sending a message from the phone goes off on its own fork instead of into the CLI session you already have running.
- After an update, the phone acts as if the computer was never paired. An OpenAI staff reply in that thread points back to
codex remote-control pair.
My read: it's a real command and worth trying, especially for new chats started from the phone. Just don't build a workflow that depends on it continuing to work the same way, because the official page says the CLI isn't a supported setup path for mobile.
Option 3: SSH + tmux from your phone
The old reliable. On the server:
tmux new -s codex # or: tmux attach -t codex
codexOn the phone, any SSH client (Termius, Blink, Moshi, Termux on Android). Use mosh if your connection roams, and Tailscale if you don't want to open SSH to the internet.
- Good: nothing new to trust, works with any agent, survives disconnects because tmux holds the session.
- Catch: you're reading a full terminal UI on a phone. Diff review, long approval prompts and "which of my three panes is blocked?" are where it gets tiring. There are no push notifications unless you wire up hooks yourself.
If you only check in occasionally, this is fine and free.
Option 4: a companion app that runs on the Linux box
This is the category I work in, so weigh my opinion accordingly: I'm the maintainer of Happier, an open-source companion app for coding agents (Codex, Claude Code, OpenCode and others). There are other apps in this space too, and some of them support Codex on Linux. I'll describe the Happier setup because it's the one I can vouch for step by step.
The model is different from options 1 and 2: you install the Happier CLI on the Linux box, it registers that box as a machine on your account, and the phone talks to the box through a relay (Happier Cloud, or one you host yourself). Session content is end-to-end encrypted by default. Metadata such as ids, timestamps and device ids is not.
1) Install Happier on the Linux box
curl -fsSL https://happier.dev/install | bash
happier setuphappier setup asks which relay to use, signs you in, registers this machine and sets up automatic startup of the background service.
If you'd rather drive it from a desktop, the desktop app can set up a remote machine over SSH instead (Add machine over SSH in Machines settings, or happier machine setup --ssh user@host from a computer that already has the CLI).
2) Make sure Codex is installed and signed in on the box
happier install provider codex # or: npm install -g @openai/codex
codex --version # shared TUI control needs 0.131.0 or newerThen sign in. You can run codex login on the box, or let Happier hold the credential:
happier connect codex --device # device-code flow, handy on a headless box
happier connect codex --paste # fallback: paste the redirect URL
happier connect codex --api-key # API key modeDevice auth can require enabling "device code authorization for Codex" in your ChatGPT settings first.
3) Start the session from either side
From the box (inside tmux, so the TUI survives an SSH drop):
cd ~/src/my-repo
happier codexOr from the phone: new session, pick the Linux machine, pick Codex, type the task.
4) Use the phone and the TUI on the same thread
Since Happier 0.2.13, with Codex CLI 0.131.0 or newer on macOS or Linux, Happier and the Codex TUI connect to the same running app-server thread. You can type in the TUI over SSH, then approve the next command from the phone, and both stay live. If a session was started from the phone, happier attach <session-id> on the box opens the TUI on that same session.
The honest limits:
- Shared control only applies to sessions started through Happier. If you started a thread directly with
codex, Happier can't join it while it's running, because Codex keeps one active writer per thread. - On Windows, in ACP mode or with an older Codex CLI, control is exclusive: a message from the phone waits until the terminal turn reaches a safe boundary.
- The Linux box has to be online. Happier doesn't fix a box that's off, a dropped network or a provider outage. It just makes the box the only thing that needs to be awake.
Optional: if you use Herdr as your terminal multiplexer, the Happier 0.2.16 release adds it as a terminal host for new sessions (Herdr 0.9.2 or newer, macOS and Linux). Some docs pages still label this a development-build feature while they catch up.
Which one should you pick?
| You have... | Pick |
|---|---|
| An always-on Mac or Windows PC, and only use Codex | OpenAI's Remote (option 1) |
| Only the Linux box, and you mostly start new chats from the phone | Try codex remote-control (option 2), keep option 3 as a fallback |
| Only the Linux box, and you want to answer approvals and review diffs comfortably | A companion app on the box (option 4) |
| No wish to install anything new | SSH + tmux (option 3) |
Troubleshooting
"remote control requires ChatGPT authentication"
You're signed in with an API key. Sign Codex in with your ChatGPT account (codex login and pick ChatGPT) for options 1 and 2. In Happier, API-key mode works via happier connect codex --api-key, but check which account you want sessions to bill against.
The phone shows the "connect your Mac" welcome screen again
On option 2 this is the most common report. Re-run codex remote-control pair and pair again. If it keeps happening, that's the unsupported part of the path showing. Option 1 or 4 is the stable route.
Messages from the phone start a new chat instead of continuing my CLI session
That's the fork behavior people report on option 2. With Happier, start the session through happier codex (or from the app) so the TUI and phone share the same thread. A thread started with plain codex can't be joined live.
Happier shows the Linux machine as offline
On the box:
happier daemon status --allMake sure the box and the phone use the same relay and account. If the service runs but sessions fail to start Codex, check that codex is on the PATH the background service sees, not only your interactive shell's.
FAQ
Do I need a Mac to control Codex from my phone?
For OpenAI's supported Remote path, yes: a Mac or Windows PC running the ChatGPT desktop app (as of 2026-10-11). The codex remote-control CLI path and third-party companion apps don't need one.
Does the work run on my phone or in the cloud?
In all four options the code and commands run on the Linux box. The phone sends prompts and approvals. (Codex cloud tasks are a separate OpenAI product and are not covered here.)
Can I do the same with Claude Code?
Yes, and Anthropic's own Remote Control has different requirements (claude.ai sign-in, not an API key). See How to monitor Claude Code from your phone.
Is Happier free?
The app and CLI are open source. Codex itself still bills through your OpenAI plan or API key.
Get Happier
Happier is an open-source, end-to-end encrypted companion to run and orchestrate AI coding agents from phone, desktop, and web.