Home/Guides/How to install and sign in to Codex CLI on a remote Mac mini

How to install and sign in to Codex CLI on a remote Mac mini

Updated · airankrush

What this guide covers

When you finish, running codex in the remote Mac's terminal gets you working. You need: your own ChatGPT account or API key, and a working remote desktop.

Steps

  1. Choose one official install method

    The README of the official Codex repository and the official docs list three. One is enough:

    curl -fsSL https://chatgpt.com/codex/install.sh | sh

    or npm install -g @openai/codex, or brew install --cask codex. The npm method assumes Node was installed in your user directory by a version manager, so that a global install needs no administrator password.

  2. Upgrade the same way you installed

    The update method in the official docs is to run the same install script again. Installs made with npm or Homebrew use their own upgrade commands. Remember which method you used. Mixing them leaves two codex binaries in the terminal and no easy way to know which one runs; which codex tells you.

  3. Sign in inside the remote desktop

    Go into your project directory and run codex. On first launch, choose Sign in with ChatGPT or another available sign-in method. The browser sign-in page opens on the remote Mac, so complete it in the remote desktop view. The official README says an API key also works but needs extra setup; follow the official authentication docs for the steps. We have not verified item by item where credentials are cached on the machine, so rely on the official docs for that.

  4. Sharing the machine with other agents: separate sessions and directories

    Installing Codex and Claude Code on one machine causes no conflict, because each has its own config directory. The trouble comes from letting two agents change the same working directory at the same time. The approach: one tmux session per agent, and when the same repository needs parallel work, use git worktree add to give each agent its own working tree.

  5. Set approvals on the assumption that nobody is watching

    On your own computer you see every step the agent takes. On a remote machine it often runs unattended. Codex has its own approval and sandbox settings (see the official docs). Before you allow automatic execution, think it through: what it can reach is not just the project directory but also the accounts and keys you have signed in to on this machine. The platform's management components and network configuration must not be changed, and that applies to you and to any agent you authorize.

  6. Sign out and clean up before the rental ends

    Sign out of Codex, delete its config directory (see the official docs for the location), and revoke the API key you created for this machine in the OpenAI dashboard. Push all changes to your own repository before handing the machine back.

FAQ

Can I rent just the machine and use my own ChatGPT account?

Yes. The account, subscription and usage are all a matter between you and the provider. We promise no quota and make no promise about the status of the account.

If I disconnect the remote desktop while Codex is running in the background, does it stop?

Disconnecting the remote desktop does not stop programs on the remote machine. Closing the terminal window does. Put it in a tmux session; see keeping long tasks running.

Can I turn the subscription on this machine into an API for the rest of my team to call?

No. The terms of use prohibit turning a subscription account into an outward-facing API or relay, and prohibit sharing it among several people.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All guides