Steps
-
Get a server and a user for the agent
Take Ubuntu 20.04 or newer, or Debian 10 or newer. Codex asks for 4 GB of memory at least and recommends 8 GB. Do not run it as root: a separate user keeps its mistakes inside one home folder.
$ ssh [email protected] $ adduser dev $ usermod -aG sudo dev $ su - dev
-
Install Codex
The official installer works on Mac and Linux. If you prefer npm,
npm install -g @openai/codexdoes the same.$ curl -fsSL https://chatgpt.com/codex/install.sh | sh -
Start a tmux session
tmux keeps programs running after you disconnect. Everything you start inside it survives a closed SSH window.
$ sudo apt install -y tmux git $ tmux new -s codex
-
Sign in with a one-time code
Run the command, open the link it prints in the browser on your laptop and enter the code. The server needs no browser. Then check the result.
$ codex login --device-auth $ codex login status
Using an API key instead? Pipe it in rather than typing it as an argument:
$ printenv OPENAI_API_KEY | codex login --with-api-key -
Open your project and start Codex
Clone the repository and run
codexin it. Describe the task as you would to a colleague.$ git clone https://github.com/you/your-project.git && cd your-project $ codex
For a one-off job that needs no conversation,
codex execruns without a chat window and prints the result.$ codex exec "run the tests and fix what fails" -
Detach and close the laptop
Press
Ctrl+B, thenD. You leave tmux, and Codex keeps working. Close the laptop.
Check that it works
Connect again later, attach to the same session and you see Codex where it is now. If you started it outside tmux by mistake, codex resume continues the last session.
$ ssh [email protected] $ tmux attach -t codex # or, to pick up the last conversation: $ codex resume
If the one-time code is not available
Device sign-in must be switched on in your ChatGPT security settings or in the workspace permissions. If it is off, or you cannot change it, there are three other ways in.
| Way | Command | Use it when |
|---|---|---|
| One-time code | codex login --device-auth | The default. Works over plain SSH. |
| SSH port forward | Forward port 1455, then run codex login on the server | Device sign-in is off, but you can forward a port. The sign-in page opens in your laptop's browser. |
| Copy the cache | Copy ~/.codex/auth.json to the server | You are already signed in on the laptop. The file holds access tokens: treat it like a password. |
| API key | printenv OPENAI_API_KEY | codex login --with-api-key | You pay per use through the API instead of a ChatGPT plan. |
The commands for the two middle ways. Run both on the laptop:
# port forward: keep this SSH window open, then run "codex login" in it $ ssh -L 1455:localhost:1455 [email protected] # copy the cache $ ssh [email protected] 'mkdir -p ~/.codex && cat > ~/.codex/auth.json' < ~/.codex/auth.json
What Codex may do on its own
An agent that works while you sleep needs limits. Two flags set them: --sandbox takes read-only, workspace-write or danger-full-access, and --ask-for-approval decides when Codex stops to ask you (for example on-request or never). Start with workspace-write. Keep API keys and cloud credentials out of the home folder of the user that runs the agent.
The short way: a computer that is ready for it
On Uno you skip the server, the install and tmux. Get a computer, open Uno Work, sign in with your ChatGPT subscription, give Codex the task in a chat and close the laptop. Check the result from any browser. Codex asks for 4 GB of memory, so take Plus (4 GB) or above.
Plus: $20 a month
Run Codex from a clean address of your own
Your computer runs in the Netherlands. Its traffic can leave through a static address of a regular internet provider in one of 8 countries. Only your account works from that address.
- From a data-center address
- Sites see a server range shared with thousands of strangers. The agent's browser hits more captchas and blocks.
- From your Clean exit IP
- Sites see a regular internet provider's address in the country you picked. Fewer captchas, and less reason for Claude or ChatGPT to flag your account: nobody else works from it.
Codex needs 4 GB: start with Plus
Every plan is a real Linux computer with root. Plus has 4 GB and Uno Work in the cloud; move up any time, your files come with you.
Small
A Telegram bot, a VPN, a small backend
$5/ month
- 1 vCPU · 1 GB
- 15 GB disk
- 25 GB cloud storage
- 5 boosts a month
Plus
Agents that work with your laptop closed
$20/ month
- 4 vCPU · 4 GB
- 40 GB disk
- 100 GB cloud storage
- Uno Work in the cloud
Pro
A product in production, a second MacBook
$70/ month
- 16 vCPU · 16 GB
- 120 GB disk
- 300 GB cloud storage
- Speed of a MacBook Air M4
Max
A team and many agents at once
$200/ month
- 32 vCPU · 48 GB
- 300 GB disk
- 1,024 GB cloud storage
- 5 public IPv4
Add Uno AI to any plan: 40 h of AI work a month on Small, 100 h on Plus, unlimited on Max. Today: GLM-5.3 Flash and MiMo v2.6 Pro. Or sign in with your own Claude or ChatGPT.
Common problems
"codex: command not found" after installing
npm install -g @openai/codex.The device code sign-in is refused
Codex stops when I close SSH
tmux new -s codex first, then codex inside it. To go back to the last conversation, use codex resume.