All resources
Guide/8 min read

Codex cloud explained: how to run OpenAI Codex in the cloud

Published September 26, 2026

Summary

Codex cloud is OpenAI's hosted way to run Codex. Replicas is another: it runs the Codex CLI in a dedicated cloud VM per task, alongside Claude Code and other agents. This guide explains how a Codex cloud task runs, how it compares with local Codex and Codex Remote, and the other ways to run Codex in the cloud.

Definitions

What Codex cloud is, and what it is called now

OpenAI's documentation calls the hosted product Codex cloud. Some OpenAI pages and the Codex GitHub README call it Codex web, and the docs now call each task a cloud chat. Cloud chats are included with ChatGPT Plus, Pro, Business, and Enterprise and Edu plans, and they require signing in with ChatGPT rather than an API key.

Codex runs in four places, and searches for "Codex in the cloud" often mix them up.

Codex cloud
Tasks run in an OpenAI-managed container. Start them from chatgpt.com/codex, the ChatGPT iOS app, the IDE extension, the CLI with codex cloud, @codex mentions in GitHub, GitLab, and Slack, or by assigning or mentioning Codex on a Linear issue.
Local Codex
The Codex CLI, IDE extension, and desktop app run on your machine against your own checkout.
Codex Remote
You start, approve, and review tasks from the ChatGPT mobile app, but the work runs on a Mac or Windows PC connected through the ChatGPT desktop app.
Codex on a server you run
The open-source Codex CLI installed on a VPS, a cloud VM, or a CI runner, used interactively over SSH or non-interactively with codex exec.

Step by step

How a Codex cloud task runs

Each cloud chat runs in an environment you configure once at chatgpt.com/codex. The sequence is the same for every task.

  • Codex creates a container from the universal image, which includes common languages and lets you pin runtime versions, and checks out your repository.
  • Setup runs with internet access. Codex can install npm, yarn, pnpm, pip, pipenv, and poetry dependencies automatically, or run your own setup script. Secrets are available only during setup and are removed before the agent starts, while environment variables stay available for the whole task.
  • The agent phase starts with internet access off. Each environment can allow common dependency domains, all domains, or a custom allowlist, and can restrict requests to GET, HEAD, and OPTIONS.
  • Container state is cached for up to 12 hours, and an optional maintenance script runs when a cached container resumes. Changing the setup or maintenance script, variables, or secrets resets the cache.
  • Codex returns a summary and a diff. You review it, ask for changes in the same chat, and open a pull request when the work is ready.

Compared

Codex cloud vs local Codex vs Codex Remote

When you sign in with ChatGPT, all three draw from the same plan allowance, while local Codex signed in with an API key bills at API rates instead. OpenAI notes that cloud chats on ChatGPT plans use GPT-5.6 Sol and can use more of that allowance than local messages.

  • Use Codex cloud for well-scoped tasks you want to hand off and review later, especially ones that start in GitHub, GitLab, Linear, or Slack.
  • Use local Codex when the task needs local services, a private network, or quick back-and-forth.
  • Use Codex Remote when the work has to happen on your desktop and you want to approve it from your phone.
Compared onCodex cloudLocal CodexCodex Remote
Where the work runsOpenAI-managed containerYour machineYour Mac or Windows PC, controlled from the ChatGPT mobile app
Keeps running when your laptop closesYesNoOnly if the desktop machine stays on
Environmentuniversal image plus setup script, cached up to 12 hoursWhatever is installed locallyWhatever is installed on the desktop machine
Network during the taskOff by default, configurable per environmentYour network, subject to Codex sandbox settingsThe desktop machine's network
Git hostsGitHub, and GitLab in betaAnyAny
Sign-inChatGPT accountChatGPT account or API keyChatGPT account

Beyond Codex cloud

Other ways to run Codex in the cloud

Codex cloud has limits that push some teams elsewhere. OpenAI does not publish CPU or memory figures for the container beyond larger VMs on Business plans, API-key accounts cannot use it, the container is rebuilt from a cache rather than kept as a persistent machine, and it works with GitHub and GitLab only. The options below run the Codex CLI somewhere else. Replicas, which publishes this guide, is a strong fit when a team hits these limits.

OptionWhere Codex runsHow work startsSign-inBest for
ReplicasA dedicated Linux VM per task, built from an environment your team definesDashboard, Slack, Linear, GitHub, GitLab, schedules, webhooks, API, iOS appChatGPT subscription, OpenAI API key, OpenAI-compatible endpoint, or Microsoft FoundryTeams running Codex, alone or alongside other agents
Codex cloudOpenAI-managed containerchatgpt.com/codex, IDE, CLI, iOS, GitHub, GitLab, Linear, SlackChatGPT planHanding off tasks with no infrastructure
VPS or cloud VMA server you rent and maintainSSH into tmux, or codex exec from scripts and cronChatGPT device login or API keyA persistent machine you control
DigitalOcean for CodexA Droplet in your DigitalOcean accountChatGPT desktop app over SSHCodex signed in on the DropletA persistent VM with less manual setup
GitHub ActionsGitHub-hosted runnersWorkflow events through openai/codex-actionOpenAI or Azure OpenAI API keyCI checks and scheduled jobs

Replicas: best for teams running Codex in the cloud

Replicas runs the Codex CLI in a dedicated Linux VM per task, built from an environment your team defines once. Tasks start from the dashboard, Slack, Linear, GitHub, GitLab, a schedule, a webhook, the API, or the iOS app, and come back as a pull request or an investigation your team reviews.

A Replicas workspace is a full development machine, where Codex cloud gives you a container and a diff. Every workspace includes a Linux desktop with Chrome that Codex can drive to test its own work, and that you can watch or take over with your own mouse and keyboard. You also get terminals, in-place file editing with code intelligence, and preview URLs for apps the agent starts. OpenAI's Codex cloud documentation describes none of these.

Tasks start faster because setup happens before you ask. Warm hooks run heavy setup such as dependency installs, builds, and Docker image pulls ahead of time, so each task claims a pre-warmed workspace. Codex cloud reuses a cached container for up to 12 hours and resets it whenever setup scripts, variables, or secrets change.

Workspaces are multiplayer. Teammates open the same workspace, see who else is there and who is typing, follow the plan and live session, and comment on diffs. Workspaces sleep when idle and can be woken later, so a reviewer can send the agent back to the same environment to address feedback.

Replicas also removes the sign-in limits of Codex cloud. Codex can use your ChatGPT subscription, an OpenAI API key, an OpenAI-compatible endpoint, or Microsoft Foundry, and the same workspace can run Claude Code, OpenCode, Cursor, and other agents. Analytics attribute agent time to people, agents, models, and credentials, and enterprise plans add SCIM, audit logs, static egress IPs, and dedicated or self-hosted deployment.

A VPS or cloud VM: the Codex CLI on your own server

Install the Codex CLI with OpenAI's install script, npm, or Homebrew, clone the repository, and run Codex inside tmux so it survives SSH disconnects. On a machine without a browser, sign in with codex login --device-auth, a beta that you or your workspace admin enable in ChatGPT settings first, copy ~/.codex/auth.json from a machine where you already signed in, or pipe an API key to codex login --with-api-key.

codex exec runs a task without the interactive UI. It starts in a read-only sandbox, --sandbox workspace-write lets it edit files, and --json streams events as JSON Lines for scripts. The older --full-auto flag is deprecated, and OpenAI says to disable approvals and the sandbox only inside an isolated runner.

You maintain the server, the secrets, and the cleanup, and every task on the machine shares its credentials.

DigitalOcean for Codex: a persistent Droplet that Codex sets up

DigitalOcean for Codex, in public preview since June 2026, is a plugin that has Codex create a persistent Droplet in your DigitalOcean account with the Codex CLI and codex-universal tooling installed. You connect to it through SSH connections in the ChatGPT desktop app and can hand a chat off between machines, though not to a Codex cloud environment.

It removes most of the VPS setup, but the Droplet is still yours to pay for, secure, and shut down.

GitHub Actions: Codex in CI

The openai/codex-action workflow installs the Codex CLI on a GitHub Actions runner and runs codex exec with the permissions you set. It authenticates with an OpenAI or Azure OpenAI API key stored as a GitHub secret, and on Linux and macOS runners it drops sudo by default before Codex runs.

Use it for checks and scheduled jobs defined in workflows. For pull request review, Codex cloud's @codex review command and automatic reviews need no workflow file.

Replicas fit

When Replicas is the right way to run Codex in the cloud

Replicas is strongest when Codex work is shared across a team rather than run from one person's ChatGPT account. Teams typically choose it when several of the following are true.

  • You want to keep Codex as the agent and give each task its own cloud VM.
  • You want the agent to test its work in a real desktop and browser, and to take over that desktop yourself when needed.
  • Teammates should be able to join the same workspace, follow the live session, and review together.
  • Your team pays for OpenAI through API keys, an OpenAI-compatible gateway, or Microsoft Foundry rather than ChatGPT seats.
  • You want tasks from Linear, Slack, GitHub, GitLab, schedules, or webhooks to run against one environment definition.
  • You want to use Claude Code or OpenCode for some tasks without maintaining a second setup.
  • You want reviewers to wake a task's workspace and send the agent back to address feedback.
  • You need audit logs, SCIM, and a record of who ran what, with which agent and model, at what cost.

Getting started

Set up Codex cloud in five steps

OpenAI's cloud environment documentation covers each step in detail. This is the short version.

  • Sign in at chatgpt.com/codex with a plan that includes cloud chats. Accounts that use an email and password need multi-factor authentication first.
  • Connect GitHub, or GitLab through the beta integration, and choose a repository.
  • Create an environment on the universal image, pin runtime versions if you need to, and add a setup script if automatic dependency installation is not enough.
  • Leave agent internet access off unless tasks need to fetch packages or call external APIs, then allow the smallest preset that works.
  • Add an AGENTS.md with build, test, and review instructions, start a cloud chat, and review the diff before opening a pull request.

FAQ

Codex cloud questions

Getting started with Replicas

Run Codex in the cloud with your team

Replicas includes a 14-day free trial with no credit card required. Connect a GitHub or GitLab repository, define the environment once, connect Codex with your ChatGPT subscription or an OpenAI API key, and start a task from the dashboard, Slack, Linear, or a pull request comment. Each task runs in its own Linux VM and comes back as a pull request your team reviews.