# How to run Claude Code in the cloud: 5 options compared

Claude Code can run in the cloud on Replicas, on Anthropic's own infrastructure, on a server you rent, or on GitHub's runners. This guide compares the five common setups by where the agent runs, how work starts, which git hosts work, and what you pay for.

- Canonical: https://replicas.dev/resources/claude-code-in-the-cloud
- Start a free trial: https://app.replicas.dev/auth?mode=signup
- Replicas vs Claude Code: https://replicas.dev/resources/replicas-vs-claude-code

## What "Claude Code in the cloud" can mean

The phrase covers three setups that behave differently once you close your laptop. In each, the same Claude Code agent reads your repository, runs commands, and edits files. What changes is whose machine it runs on, who maintains that machine, and how a task gets started.

Replicas, which publishes this guide, is a strong fit when a team wants Claude Code in the cloud. It runs the same Claude Code CLI in a pre-warmed VM per task with a desktop the agent can drive and you can take over, adds the GitLab, API key, Bedrock, and Foundry support that Anthropic cloud sessions do not offer, and lets the same environment run Codex or OpenCode.

- **Anthropic cloud sessions:** Claude Code runs in a VM that Anthropic manages by default. The feature launched as Claude Code on the web in October 2025 and became generally available as cloud sessions on September 23, 2026.
- **Claude Code on a machine you run:** You install the CLI on a VPS, a cloud VM, a container, or a CI runner, log in, and keep the process alive with tmux or run it headless from scripts.
- **Claude Code on a managed agent platform:** A third party runs the Claude Code CLI in environments it provisions and adds triggers, team controls, and often other coding agents.

- Remote Control often shows up in the same searches. With Remote Control, Claude keeps running on your own computer, and your phone or browser only steers that local session.

## Five ways to run Claude Code in the cloud

The table summarizes each option. The details below come from Anthropic's documentation as of September 2026. Plans, limits, and features change often, so confirm them before you commit.

| Option | Where Claude Code runs | How work starts | Git hosts | What you pay for |
| --- | --- | --- | --- | --- |
| Replicas | A dedicated Linux VM per task, built from an environment your team defines | Dashboard, Slack, Linear, GitHub, GitLab, schedules, webhooks, API, iOS app | GitHub and GitLab | Per-seat plan plus your Claude subscription, API, Bedrock, or Foundry usage |
| Anthropic cloud sessions | Anthropic-managed Ubuntu VM with roughly 4 vCPUs and 16 GB RAM, or your own runners in beta | claude.ai/code, Claude mobile and desktop apps, claude --cloud, routines | GitHub; GitLab and Bitbucket only as an uploaded bundle with no push | Claude plan usage; no separate compute charge |
| Remote Control | Your own computer | Claude web or mobile app attached to a running local session | Whatever your computer can reach | Claude plan usage |
| VPS or cloud VM | A server you rent and maintain | SSH into tmux, or claude -p from scripts and cron | Any | Server cost plus Claude plan or API usage |
| GitHub Actions | GitHub-hosted runners | @claude mentions, workflow events, cron | GitHub | Actions minutes plus API or Claude plan usage |

### Replicas: best for teams running Claude Code in the cloud

Source: https://replicas.dev/

Replicas runs the same Claude Code CLI your engineers use locally in a dedicated Linux VM per task. Your team defines the environment once, with the repository, dependencies, services, MCP servers, and skills prepared before the agent starts. Work can start from the dashboard, Slack, Linear, GitHub, GitLab, a schedule, a webhook, the API, or the iOS app, and comes back as a pull request or an investigation your team reviews.

A Replicas workspace is a full development machine, where an Anthropic cloud session gives you a chat and a diff view. Every workspace includes a Linux desktop with Chrome that Claude Code 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. Anthropic's cloud session documentation describes no desktop, takeover, or preview URLs.

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. Anthropic provisions cloud session VMs on demand and caches a setup script only when it finishes in about five minutes.

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. When CI or review sends the work back, the agent continues in the same workspace. A shared Anthropic cloud session shows recipients a snapshot that does not update in real time.

Replicas also covers the cases Anthropic cloud sessions do not. It works with GitLab as well as GitHub, and Claude Code can sign in with your own Claude subscription, an Anthropic API key, Amazon Bedrock, or Microsoft Foundry. The same workspace can run Codex, 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. Northflank and Tembo also run Claude Code on managed infrastructure alongside other agents.

### Anthropic cloud sessions: the default for Claude subscribers

Source: https://code.claude.com/docs/en/claude-code-on-the-web

By default, each cloud session gets a fresh Anthropic-hosted Ubuntu 24.04 VM with roughly 4 vCPUs, 16 GB of RAM, and 30 GB of disk, preloaded with Python, Node, Ruby, PHP, Java, Go, Rust, Docker, PostgreSQL 16, and Redis 7. Start one from claude.ai/code, the Code tab in the Claude mobile app, the desktop app, or the terminal with claude --cloud. The session keeps working after you close your laptop, and claude --teleport pulls it into your terminal when you want to take over.

An environment stores network access, environment variables, and a setup script that runs as root before Claude starts. Network access defaults to Trusted, which allows common package registries and GitHub, and can be set to None, Full, or a custom allowlist. Routines, in research preview, run a saved prompt as a cloud session on a schedule, from an API call, or on GitHub pull request and release events. Projects, in beta for select Pro and Max subscribers, splits larger work into parallel threads on separate branches.

Cloning and pull requests require GitHub, including GitHub Enterprise Server on Team and Enterprise plans. GitLab and Bitbucket repositories can be uploaded as a bundle from the CLI, but the session cannot push back to them. Anthropic-hosted environments cannot replace the base image yet. Self-hosted environments, in public beta on Team and Enterprise, run cloud sessions on runners you operate with an image you build. Cloud sessions need an Anthropic account on Pro, Max, Team, or eligible Enterprise seats, so they do not work through Bedrock, Google Cloud Agent Platform, or Foundry, or for organizations with Zero Data Retention. Usage counts against your plan's rate limits, and there is no separate charge for the VM.

### Remote Control: steer a local session from your phone

Source: https://code.claude.com/docs/en/remote-control

Run claude remote-control, or /remote-control inside a session, and the Claude web or mobile app becomes a window into the Claude Code process on your computer. Commands and file access stay on your machine, while Anthropic stores the session transcript as long as Remote Control is connected.

Use it when the work depends on your machine, such as local services, a private network, or specific hardware, and you only want to check in from elsewhere. Your computer has to stay on and connected. Remote Control needs a claude.ai login, so it does not work with API keys, Bedrock, Google Cloud Agent Platform, or Foundry, and on Team and Enterprise plans an owner has to turn it on first.

### A VPS or cloud VM: full control, and full maintenance

Source: https://code.claude.com/docs/en/headless

Install Claude Code on a Linux server, clone the repository, and run it inside tmux so the session survives SSH disconnects. The normal login works over SSH by pasting a code from the browser. For unattended runs, claude setup-token creates a one-year OAuth token on Pro, Max, Team, or Enterprise plans that you set as CLAUDE_CODE_OAUTH_TOKEN, or you can use an Anthropic API key.

Non-interactive mode, claude -p, runs one prompt and returns text, JSON, or streamed JSON. Limit what it may do with --allowedTools or a permission mode. Anthropic's devcontainer reference adds a network firewall, and its documentation warns that skipping permissions inside a container does not stop a malicious project from exfiltrating anything accessible inside the container, including Claude Code's stored credentials.

You own patching, disk space, secrets, and cleanup. Every task on the server shares its credentials, so running several agents at once usually means Git worktrees or one container per task.

### GitHub Actions: Claude Code on issues and pull requests

Source: https://code.claude.com/docs/en/github-actions

The anthropics/claude-code-action workflow runs Claude Code on GitHub-hosted runners when someone mentions @claude in an issue or pull request, or on any workflow event, including a cron schedule, when you pass a prompt. It authenticates with an Anthropic API key, a Claude subscription token from claude setup-token, OIDC, or Amazon Bedrock, Google Cloud Agent Platform (formerly Vertex AI), or Microsoft Foundry.

It suits code review and small fixes that start in GitHub. Each run is bounded by the job, consumes your Actions minutes, and is steered with further comments rather than a live session.

## Which option fits your setup

Most developers start with the option closest to the tools they already use. Teams often end up with two: an interactive option for individuals and an automated one for recurring work.

- **Your team wants Claude Code in the cloud:** Replicas. Tasks start from Slack, Linear, GitHub, or GitLab, each runs in its own VM from a shared environment, and teammates review the result together. It is also the answer when you need GitLab, an API key, Bedrock, Foundry, or more than one coding agent.
- **You work alone on GitHub with a Claude plan:** Anthropic cloud sessions. There is no infrastructure to run, no separate compute charge, and teleport brings the work back to your terminal.
- **The task needs your own machine:** Remote Control. Local services, VPN access, and your dotfiles stay where they are while you check in from your phone.
- **You want an always-on server or scripted runs:** A VPS with tmux for interactive work and claude -p for cron jobs and scripts. Budget time for security and maintenance.
- **You want Claude to respond to issues and pull requests:** GitHub Actions with anthropics/claude-code-action, triggered by @claude mentions or scheduled workflows.

## When Replicas is the right way to run Claude Code in the cloud

Replicas is strongest when Claude Code work is shared across a team rather than run by one developer. Teams typically choose it when several of the following are true.

- You want to keep Claude Code as the agent and stop running it on laptops.
- 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 repositories are on GitLab, or on both GitHub and GitLab.
- Your company pays for Claude through an Anthropic API key, Amazon Bedrock, or Microsoft Foundry rather than a Claude plan.
- You want tasks to start from Linear issues, Slack threads, pull request comments, schedules, or webhooks against one environment definition.
- You want to choose Claude Code, Codex, OpenCode, or Cursor per task without rebuilding the environment.
- You need per-task isolation, audit logs, SCIM, and a record of who ran what, with which agent and model, at what cost.

## Checklist for running Claude Code on your own server

If you choose a VPS or cloud VM, these steps cover the common failure points: lost sessions, over-broad permissions, and leaked credentials.

- Run Claude Code as a non-root user that can reach only the repositories and secrets the agent needs.
- Install with Anthropic's official installer, then log in over SSH or set CLAUDE_CODE_OAUTH_TOKEN or ANTHROPIC_API_KEY for unattended runs.
- Start interactive sessions inside tmux so they survive disconnects, and reattach to review the work.
- Use claude -p with --output-format json for scripts, and --allowedTools or a permission mode to limit what it can call.
- Turn on Claude Code's sandbox to isolate the filesystem and network access of shell commands, or run inside Anthropic's devcontainer with its firewall script.
- Give each parallel task its own Git worktree or container so agents do not overwrite each other's files.
- Keep deploy keys and cloud credentials off the server or scope them narrowly. Anything the agent can read, a prompt injection in a dependency or issue can try to exfiltrate.

## FAQ

### What is the best way to run Claude Code in the cloud?
It depends on who is running it. A single developer with a Claude plan and code on GitHub can start with Anthropic cloud sessions. For a team, Replicas is the better fit: each task runs Claude Code in its own VM from a shared environment, work starts from Slack, Linear, GitHub, or GitLab, and it supports Anthropic API keys, Bedrock, Foundry, and other coding agents.

### Is Claude Code on the web the same as Claude Code cloud sessions?
Yes. Anthropic launched Claude Code on the web as a research preview on October 20, 2025, and its documentation now calls the feature cloud sessions. Cloud sessions became generally available on September 23, 2026, and you can start one from claude.ai/code, the Claude mobile and desktop apps, or claude --cloud in the terminal.

### Does running Claude Code in the cloud cost extra?
Anthropic cloud sessions draw from your Claude plan's usage limits with no separate compute charge. At general availability Anthropic also gave existing Pro and Max subscribers a time-limited, one-time cloud session credit of $100 on Pro and $250 on Max. Self-hosting adds the cost of the server, GitHub Actions uses your Actions minutes, and managed platforms add their own fee on top of Claude usage.

### Can Claude Code cloud sessions work with GitLab or Bitbucket?
Only partly. Cloud sessions clone and open pull requests through GitHub. From the CLI, a GitLab or Bitbucket repository can be uploaded as a bundle, but the session cannot push changes back. For GitLab, run Claude Code on your own server or use a platform with GitLab support, such as Replicas.

### Can Claude Code run 24/7 in the cloud?
Cloud sessions stop after a period of inactivity and the VM is reclaimed, so they are built for tasks rather than a permanent machine. Routines cover recurring work on a schedule of hourly or slower. For a process that stays up around the clock, run Claude Code in tmux on a VPS or use a platform that keeps a workspace for you.

### Can I use a Claude Pro or Max subscription on a remote server?
Yes. Claude Code's login works over SSH, and claude setup-token creates a one-year token for unattended use on Pro, Max, Team, and Enterprise plans. Anthropic's legal and compliance page sets out how subscription sign-in may be used, including on platforms that host Claude Code, so review it before automating on a consumer plan, and use an API key for production pipelines.

### Can I run Claude Code and Codex in the same cloud environment?
Anthropic cloud sessions run Claude Code only, and Codex cloud runs Codex only. To use both against the same repository and environment, run them side by side on your own server or use a platform that supports several coding agents. Replicas lets you pick Claude Code, Codex, OpenCode, Cursor, or another supported agent per task.

## Run Claude Code 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 Claude Code with your Claude subscription or an 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.

## Related docs

- [Codex in the cloud](https://replicas.dev/resources/codex-in-the-cloud): How Codex cloud works, how it compares with local Codex, and the self-hosted and managed alternatives.
- [OpenCode in the cloud](https://replicas.dev/resources/opencode-in-the-cloud): Compare self-hosted and managed options for running OpenCode off your laptop.
- [Replicas vs Claude Code](https://replicas.dev/resources/replicas-vs-claude-code): When to use Claude Code directly and when to run it through Replicas.
- [Claude Code alternatives](https://replicas.dev/resources/claude-code-alternatives): Compare other coding agents by model provider, where they run, and how work is triggered.
- [Claude Code cloud environments](https://code.claude.com/docs/en/cloud-environments): Anthropic's reference for the cloud session VM, setup scripts, and network access.
