Codex on iPhone: run the Codex CLI on your server, steer it from your phone

4 November 2026 · Daniel Bilsborough · Reviewed 4 November 2026

OpenAI's Codex CLI is a coding agent that runs in a terminal on a computer. To use it from an iPhone, run it in a Tmux session on a Mac or Linux server, then connect to that session over SSH from the phone.

Shell Drop is a free SSH client for iPhone, iPad and iPhone Duo built for that loop: read what Codex did, send the next instruction, and leave it working when you lock the phone. Codex runs on the server the whole time; the phone is the screen and keyboard.

What you need

Set it up

  1. On the server, install the Codex CLI from npm and sign in once:
    npm install -g @openai/codex
    codex
  2. Start a named Tmux session for it, and start Codex inside, in the project folder:
    tmux new -s codex
    cd ~/projects/my-app
    codex
  3. In Shell Drop, add a saved connection to the server, with a password or an SSH key. The SSH keys on iPhone guide covers keys.
  4. Connect, then attach to the session:
    tmux attach -t codex
  5. Read, type or dictate the next instruction, and press Return. To leave Codex working, detach with Ctrl-b d or just lock the phone.

For swipe scrolling through long Codex output, add set -g mouse on to the server's ~/.tmux.conf. The Tmux cheat sheet has the other lines worth adding.

What Shell Drop adds for Codex

Codex, Claude Code and other terminal agents can share one server, each in its own Tmux session, and Shell Drop shows each session as a tab. The same setup for Anthropic's agent is on Claude Code on iPhone, and features for AI agents covers the rest. If you are choosing between Claude Code's command line and its desktop app, Claude Code in the terminal vs the desktop app compares them.

Why a server and Tmux

The Codex CLI needs a real shell, a file system and the project's tools, and it can run for a long time on one task. An iPhone doesn't offer that. Running Codex on a server inside Tmux keeps the agent and its work there, and the phone can come and go: a dropped connection or a locked screen only detaches, and tmux attach picks up the same screen.

Questions

Can I run Codex on my iPhone?

The Codex CLI runs on a computer, so it runs on a Mac or Linux server and the iPhone connects to it over SSH. Start Codex in a Tmux session on the server, then attach to that session from an SSH client on the phone, such as Shell Drop.

How do I install the Codex CLI on a server?

Install it from npm with npm install -g @openai/codex, then run codex and sign in. Run it inside a Tmux session so it keeps running after you disconnect.

Does Codex keep running when I lock my iPhone?

Yes, when it runs in Tmux on the server. Locking the phone or losing signal only detaches the SSH connection; Codex keeps working, and tmux attach -t codex brings the session back.

Can I send Codex a screenshot from my iPhone?

Yes, with Shell Drop. Paste a screenshot or attach a file, photo or video from the toolbar. It uploads to the server over SSH and the file path lands at the prompt for Codex to read.

Get Shell Drop on the App Store QR code for Shell Drop on the App Store Reading on a computer? Scan the code with your iPhone camera.