Claude Code in the Cloud: Every Hosted Option
Claude Code on the web is Anthropic's own cloud, and it is genuinely good for a lot of people. It is not the only way to run Claude Code in the cloud, though: renting your own VPS from a cloud provider is the other real option, and it solves a different problem.
"Claude Code in the cloud" gets used two different ways, and mixing them up is the most common source of confusion. Sometimes it means Anthropic's own managed cloud sessions, where you never think about a server at all. Other times it means running the regular Claude Code CLI yourself, on a virtual machine you rented from a cloud provider, which is self-hosting in every meaningful sense, just on rented hardware instead of a box on your desk. This guide covers both, and how to actually set up the second one.
The two things people mean by "the cloud" here
- Anthropic's managed cloud. Claude Code on the web, at claude.ai/code. Sessions run on Anthropic-managed infrastructure inside a sandboxed VM. You do nothing to provision it; it is included in your existing plan's usage.
- Your own cloud VPS. A virtual machine you rent from a cloud provider (a budget provider, a major cloud, or a free-tier offering), on which you install and run the ordinary Claude Code CLI yourself, exactly as you would on a physical box. This is self-hosting; "the cloud" here just describes where the hardware physically lives.
If you want the fuller picture of every way to run Claude Code away from your desk, including SSH into a box you own and steering a session from your phone, see our guide to running Claude Code remotely. This guide stays scoped to the cloud-specifically question: Anthropic's cloud, or your own.
Option A: Claude Code on the web
Claude Code on the web is the zero-infrastructure option. Start a session from the browser, from the terminal with the --cloud flag, or from the Claude mobile app, and it keeps running on Anthropic's own infrastructure even after you close whatever started it. It is a strong fit for a task on a repo already hosted on GitHub, for running several tasks in parallel without owning any of the hardware, or for checking on something later without babysitting a machine.
The trade-off is that a cloud session is isolated in its own sandboxed VM: it does not see your local filesystem, your locally configured MCP servers, or credentials you have not explicitly given it. Repository access generally goes through GitHub, with a direct upload as a fallback for a local repo subject to size limits. Rate limits share your plan's usage, and exact eligibility and limits are set by Anthropic and do change, so check Anthropic's own documentation for the current specifics before relying on it for something time-sensitive.
Option B: renting your own cloud VPS
The other route is a cloud VPS: a virtual machine you rent by the month from a provider, install Node.js and the Claude Code CLI on, authenticate with your own subscription, and run exactly as you would on any box you own. Options range from budget providers pricing a small instance at a few dollars a month, to the major clouds (AWS, Google Cloud, Azure) with more configuration options and correspondingly more setup, to free-tier offerings some providers make available for a modest always-on instance. Pricing and free-tier terms change often enough that it is worth checking a provider's current page directly rather than trusting a number you read somewhere.
This route gives you everything self-hosting gives you: your own filesystem, your own MCP servers actually wired in, no sandbox limits, and full control over what is installed. It also gives you everything self-hosting costs you: you now own uptime, security hardening, and reachability for that box, the same as you would for a Mac mini on your desk.
Setting it up, at a high level
- Provision a small instance running a current Ubuntu LTS or similar Linux distribution.
- SSH in, and immediately switch to key-only authentication for future logins.
- Install Node.js and the Claude Code CLI, then authenticate with your own Claude subscription.
- Start Claude Code inside a tmux or screen session so a dropped connection does not kill it.
- Wrap the process in a systemd unit with restart-on-failure, so it survives a crash or a reboot without you noticing.
- Reach it going forward through a mesh VPN such as Tailscale or WireGuard rather than an open SSH port.
The Claude Code CLI itself is a modest process; a small, budget-tier instance handles typing prompts and light edits comfortably. Size up specifically for what you expect the agent to run on your behalf, a full test suite, a Docker build, a large compile, not for the agent waiting on your next message. See our AI agent hosting requirements guide for the fuller breakdown.
Cost and control, side by side
| Dimension | Claude Code on the web | Your own cloud VPS |
|---|---|---|
| Setup | None: sign in and go | Provision, harden, and supervise a real box |
| Recurring cost | Included in your existing plan's usage | A separate monthly VPS bill, typically small |
| Filesystem & MCP servers | Sandboxed VM; not your local environment | Full access, entirely yours to configure |
| Repository access | Primarily via GitHub, with a direct-upload fallback | Any repo you can clone or copy onto the box |
| Who owns uptime | Anthropic | You |
Which one should you actually pick
If you do not want to administer a server at all, Claude Code on the web is the better default; it is genuinely good for the no-setup case. If you need your own MCP servers, your own credentials wired in, or work that touches files outside a single GitHub-hosted repository, a cloud VPS gets you there, at the cost of owning the same reachability and supervision work any self-hosted box requires. Our self-hosting 101 guide covers that operational side in full; if you would rather own physical hardware than rent a VPS, see our Mac mini server guide for the equivalent setup on your own desk.
Frequently asked questions
Two different things, and it matters which one you mean. It can mean Claude Code on the web, Anthropic's own managed cloud sessions at claude.ai/code, or it can mean running the regular Claude Code CLI yourself on a cloud VPS you rent from a provider. The first needs no server of your own; the second is self-hosting, just on rented cloud hardware instead of a box on your desk.
They are not really comparable costs. Claude Code on the web runs inside the usage your existing Claude plan already includes, with no separate server bill. A cloud VPS is a genuinely separate recurring cost on top of your Claude subscription, typically a small amount per month for a modest instance, in exchange for full control over the environment.
Yes, that is the main reason to choose this route. A VPS you provision yourself is a real machine with a real filesystem: install and configure your MCP servers on it exactly as you would on a local box, and Claude Code running there has the same access it would on your laptop. Claude Code on the web runs in a sandboxed VM without that access unless you explicitly configure it in.
No. The CLI process itself is lightweight; a small, budget-tier instance is enough for typing prompts and light edits. Size up specifically for what your agent will actually run there, such as a full test suite or a Docker build, not for the agent process waiting on your next prompt.
No. Repository access generally goes through GitHub, so a cloud session works with a repo already pushed there; a local repository not yet on GitHub can typically be uploaded directly as a fallback, subject to size limits. Check Anthropic's own documentation for the current, exact behaviour.