Guides

How to run Codex on a remote machine

Install the Codex CLI on a Linux machine you reach over SSH, clone your repository there, sign in, and start Codex inside tmux so it survives when you disconnect. The project, its builds and the agent then live on that machine, and your laptop only shows the terminal.

Step by step

  1. Get a machine. Any Linux server or cloud VM you can reach over SSH. Size it for the project: its builds and tests decide the memory and CPU, not Codex.
  2. Install Codex and the project. Install the Codex CLI as OpenAI’s documentation describes, clone your repository, and install its dependencies so the agent can build and test.
  3. Sign in. Run codex. With no browser on the server, follow the sign in it prints from your laptop, or set an API key in the environment.
  4. Start it inside tmux. Run tmux new -s codex, start codex in the repository, and detach with Ctrl-b d. It keeps working after you log out.
  5. Come back to it. From any machine, ssh to the server and run tmux attach -t codex to land in the same session.

Why move Codex off the laptop

The project often already lives elsewhere: a GPU box, a Linux build server, a cloud VM close to the database. Running Codex there means it builds and tests in the real environment, keeps working when the laptop sleeps, and does not drain the battery.

What you take on

The machine is yours to run: updates, firewall, disk, backups of anything not pushed. Codex runs commands as its user, so that user should hold the project’s credentials and nothing more. A second agent needs a worktree of its own.

When a hosted workspace is less work

Murmell gives Codex a cloud machine with the project on it and its real terminal in the browser, with nothing to install. Claude Code can run next to it on the same files, each agent reserves the files it edits, and teammates open the same canvas from a computer or a phone. Codex in the cloud has the details.

Straight answers

Does Codex keep running after I close the SSH connection?

Only inside a terminal multiplexer such as tmux or screen. Started directly in the SSH session, it stops when the connection drops.

Can I run Codex and Claude Code on the same remote machine?

Yes. Give each agent its own tmux window and its own git worktree, so they never edit the same checkout at once.