Guides

How to run Codex in the cloud

Compare the common ways to keep Codex working off your laptop: what the agent can reach, what it keeps between turns, and what each one costs.

The short answer

There are four common ways to run Codex in the cloud. Codex cloud is included in ChatGPT plans and suits tasks that need only your repositories. Each task runs on an OpenAI VM, created from an environment that Codex helps you prepare. A VM you manage, with Codex in tmux over SSH, can be a cheap solution for people who want full control and are ok maintaining a server. Managed platforms run Codex and other agents on machines built from setup scripts. Boxes.dev runs Codex and Claude Code on full copies of a cloud machine where your app already runs, so the agent can start your app and test its changes.

Why move Codex off your laptop

Codex can work in your project directory, in a Git worktree on your computer, on a server you connect to over SSH, or in OpenAI's cloud. Local and worktree chats run on your computer, so if that's a laptop, they pause when it sleeps. Running Codex on a cloud machine helps in three ways:

  • Work continues while you're away. A long task can run through a meeting or overnight, and you can check on it from your phone.
  • Tasks don't compete for one machine. Local tasks share your laptop's ports, databases, and memory, even when each one has its own worktree.
  • The agent stays away from your personal files and credentials. You can give it broader permissions on a machine that holds only what the task needs.

The options below differ most in what the cloud machine starts with and what it keeps between turns. Those differences determine whether Codex can run your app and test its changes the way you would.

The options at a glance

As of September 2026. Managed platforms differ too much from each other to fit in one column, so they're described in their own section.

Codex cloudA VM you manageBoxes.dev
Where Codex runsA VM for each task, created from an environment you publishA server you rent, such as a DigitalOcean Droplet or an EC2 instanceA devbox for each task: a full, isolated copy of a cloud machine where your app already runs
What the machine starts withYour repositories with the dependencies and tools Codex installed and tested while you prepared the environmentWhatever you install and configureA copy of a machine set up with your app's tools, databases, services, and data
Between turnsThe task keeps its own files, including uncommitted changes, and you can recover its saved state for up to seven daysIt keeps running, billed by the hour or monthIt sleeps after about five minutes, keeping files and memory, and resumes where it left off
Working on the machineCodex runs the commands, and you review its work in the chatA full shell over SSH, or the ChatGPT desktop app connected to the serverTerminal tabs, a file editor, Git review, a browser you share with the agent, and SSH
From your phoneThe ChatGPT appAn SSH appThe Boxes.dev iOS and Android apps, which include a terminal
AgentsCodexAny agent you installCodex and Claude Code
CostIncluded in ChatGPT plans, from Free and Go ($8 a month) to Plus ($20) and Pro (from $100); cloud tasks count toward the plan's usage allowanceThe server, for example $48 a month for 4 vCPUs and 8 GB on DigitalOcean or about $130 on AWS EC2, plus your ChatGPT planStarter $19 or Pro $99 per user each month, with 40 or 250 box-hours included, plus your ChatGPT plan

Codex cloud

OpenAI runs Codex cloud tasks on its own VMs, starting from a cloud environment. An environment is the reusable setup that tasks start from, with your repositories, dependencies, tools, and access settings. OpenAI updated how these environments work in September 2026.

To create one, select your repositories on the web or in the ChatGPT desktop app. Codex will inspect them, install dependencies and tools, and test the workflow, and it will ask you for any access or configuration it's missing. Review its setup report and files, then choose Publish.

To start a task on the web, choose Work in → Cloud and select a published environment. You can also start and follow tasks from the desktop app and the ChatGPT app on your phone. In an Enterprise workspace with Cloud delegation turned on, you can mention @ChatGPT in Slack or Microsoft Teams to send repository work to a Codex cloud task.

Each task gets its own isolated workspace from the published environment. A task keeps its own files, including uncommitted changes and tools it installed, so you can reopen it from another device and continue. By default, you can recover a task's saved state for up to seven days after its last turn. The VM size depends on your plan: 2 vCPUs, 8 GiB of memory, and 8 GiB of disk on Plus, and 4 vCPUs, 16 GiB, and 32 GiB on Pro, Business, and Enterprise.

An environment can allow internet access to the domains you list and can hold environment variables and network secrets. It can reach a private network through Tailscale, and Enterprise workspaces can request OIDC credentials for cloud resources. Your computer's local files, running processes, browser sign-ins, and VPN access don't carry over to a cloud task, and OpenAI lists computer and browser use as not yet supported in cloud environments.

Codex is included in every ChatGPT plan: Free, Go at $8 a month, Plus at $20, Pro from $100, Business at $20 per user each month billed annually, and Enterprise. OpenAI notes that cloud tasks can use more of your allowance than local messages do. On Plus and Business, limits apply over five-hour periods and may also apply weekly, and you can buy credits after you reach your allowance.

Codex's code reviews and its Linear and GitHub integrations still use the earlier kind of cloud environment, which runs each chat in a container and caches container state for up to 12 hours.

Codex cloud suits tasks that need your repositories and the tools Codex can install for them, especially if you'd rather not run any infrastructure.

A VM you manage

You can install the Codex CLI on any Linux server and run it inside tmux, so it keeps working after you disconnect. To set one up:

  1. Create an Ubuntu server with your cloud provider, add your SSH key, and allow only SSH through its firewall.

  2. Connect over SSH and install Codex:

    npm install -g @openai/codex
    
  3. Sign in without a browser on the server. First turn on device code login in your ChatGPT security settings, then run:

    codex login --device-auth
    

    Codex will show a link and a code. Open the link on your laptop or phone, sign in, and enter the code.

  4. Clone your repository, then install your app's dependencies, databases, and services.

  5. Start a tmux session and run Codex in it:

    tmux new -s codex
    codex
    
  6. Detach with Ctrl+B and then D. To return later, connect over SSH and run tmux attach -t codex.

You can also work on the server from the ChatGPT desktop app. Add the server to your SSH config, make sure codex is on its PATH, and connect to it as a remote host. Your chats will then run on the server with its files and tools. DigitalOcean offers a Codex plugin, in public preview, that creates a persistent Droplet with the Codex CLI in your DigitalOcean account.

Running one server can be inexpensive. As of September 2026, a DigitalOcean Basic Droplet with 4 vCPUs and 8 GB of memory costs $48 a month. On AWS, an EC2 c7i.xlarge instance of the same size costs about $130 a month on demand in US East, before storage. Either one costs the same whether or not Codex is working. Codex's usage counts toward your ChatGPT plan.

A VM gives you a Codex session that keeps working after you close your laptop and that you can reach from your phone. The server is yours to maintain, including operating system updates, SSH access, backups, and the credentials you put on it. Agents on one server share its files, credentials, CPU, memory, ports, and databases. Each task needs its own worktree and ports, and one agent's build can slow down the others. A VM fits if you want a server that stays up at the lowest cost, if your agents can share one machine, or if you like running your own server, for example for a personal project.

Managed platforms

Several products run Codex on cloud machines they prepare for you, alongside Claude Code and other agents. As of September 2026:

  • Replicas builds a VM for each task from hook scripts and keeps a pool of them ready. An idle VM sleeps after an hour and keeps its processes. Full seats start at $50 a month, and Flex seats are billed by the minute. See Boxes.dev vs Replicas.
  • Tembo gives each session a dedicated VM, prepared from a standard image and your project's setup, and destroys the VM when the session ends. Paid plans start with $60 in monthly usage allowance for up to five users. See Boxes.dev vs Tembo.
  • Niteshift prepares each task's environment from setup files it commits to your repository, and adds screenshots and videos from its browser testing to the pull request. Paid plans start with $50 in monthly credits, and active agent time costs $6 an hour. See Boxes.dev vs Niteshift.
  • Ellipsis runs Claude Code and Codex in sandboxes that last up to an hour, with agents and environments defined in YAML. It's free for individuals who connect a Claude or ChatGPT subscription. See Boxes.dev vs Ellipsis.

These platforms fit teams that want a wide choice of agents or want to start work from GitHub events and other outside tools.

Boxes.dev

Boxes.dev runs Codex and Claude Code on cloud machines that start as copies of your working development environment.

You'll start by setting up your app on a cloud machine called the Template box, with the tools, databases, services, and data it needs. A setup agent can copy the environment from your laptop, including the agent settings, skills, and MCP definitions you choose to bring, or build it from a GitHub repository. Boxes.dev saves the Template box as a snapshot. Each task then runs on its own devbox: a full, isolated copy of that machine.

You'd expect an engineer to run the app locally before shipping a change; a full dev environment lets agents do the same. On a devbox, Codex can start your app, test its changes in a browser, and reproduce bugs against your real services and data. It can also take screenshots and record video for you to review.

Boxes.dev runs Codex with your ChatGPT login or an API key. You can talk to Codex in the desktop app's conversation view or in its own terminal interface. After you've set up a project, you can also start a task on a new devbox from your own terminal:

dvb codex

For a longer task, enter /goal followed by the outcome you want, and Codex will keep working across responses until it reaches the goal or something stops it, such as a usage limit.

A devbox goes to sleep after about five minutes when no agent is working and nobody is using it. Sleep keeps its files and memory, so dev servers, databases, and terminal sessions pick up where they left off when it wakes. The devbox stays until you delete it. You'll get a notification when Codex replies or needs your input, and you can answer from the desktop app, the iOS and Android apps, or the dvb CLI. You can start work from Slack, Linear issues, or scheduled automations.

You can work on the devbox yourself, with terminal tabs, a file editor, diff review that sends your line comments to Codex, and a browser you share with the agent. The desktop app's Ports tool forwards the running app to the same port on your laptop. A public link shares the app with anyone. A Project URL gives your project one stable public address that OAuth callbacks and webhooks can use. You can also connect over SSH or open the devbox in VS Code or a JetBrains IDE.

Some things only need to be set up once for all your devboxes, including environment files, MCP servers, agent plugins, and access to AWS and private services on your Tailscale network. With your permission, Codex can start other agents on new devboxes, message them, and leave notes for them in a shared project folder. You can share a read-only link to a thread with a teammate. Teammates you allow can also start work in your project from Slack, and that work runs with your access.

As of September 2026, the free trial includes 10 box-hours. Starter costs $19 per user each month, with 40 box-hours and up to four devboxes awake at once. Pro costs $99, with 250 box-hours and up to ten awake. Extra time costs $0.75 per box-hour on Starter and $0.60 on Pro. A box-hour is one default devbox, with 4 vCPUs and 8 GiB of memory, awake for an hour. Sleeping devboxes don't use box-hours. Codex's usage counts toward your ChatGPT plan. See Plans, seats, and box-hours.

To try it, connect Codex, then set up a project from a folder on your laptop or a GitHub repository.

How to choose

  • The task needs your repositories and tools Codex can install: Codex cloud, with nothing to run yourself.
  • You want a server that stays up at the lowest cost, or you like running your own server: a VM you manage, with Codex in tmux or connected to the ChatGPT desktop app.
  • You want a wide choice of agents, or you want work to start from GitHub events: a managed platform.
  • You want Codex to run and test your full app, you want to work on the same machine, or you want Claude Code too: Boxes.dev.

You can combine them. Boxes.dev runs Codex with the same ChatGPT account, so you can keep Codex cloud for quick tasks and use devboxes for work that needs your running app.

Frequently asked questions

Does Codex keep running when I close my laptop?

Local and worktree chats pause while your laptop sleeps. Codex cloud tasks, a server running Codex in tmux, managed platforms, and Boxes.dev all keep working after you close the laptop. Codex Remote, which lets the ChatGPT app control Codex on your computer, needs that computer to stay awake.

Can I use my ChatGPT subscription on a cloud machine?

Yes. On your own server, sign in with codex login --device-auth. On boxes.dev, connect Codex with your ChatGPT login. Codex cloud always uses your ChatGPT plan. In all three cases, usage counts toward the plan's limits.

What's the difference between Codex cloud and a worktree?

A worktree is a separate checkout of your repository on your own computer. A worktree chat can use your local tools and services, but it stops when your computer sleeps. A cloud task runs on OpenAI's VM from the environment you published, keeps going without your computer, and doesn't see your local files or running processes.

Sources

Product names are trademarks of their respective owners.

Close your laptop again.

Develop in the cloud: one computer per agent, running your full app, steerable from every device you own.

Also oniOS·Android·CLI