Oblien
Tutorial

How to Run Claude Code in the Cloud Without a Local Machine

Run Claude Code on a cloud server - available 24/7 with no local machine, no SSH tunnels, and no terminal babysitting. Full setup guide.

Oblien Team profile picture
Oblien Team
1 min read

How to Run Claude Code in the Cloud Without a Local Machine

Claude Code is Anthropic's coding agent. You give it a task - "refactor this module," "add tests for this API," "debug the deployment script" - and it works through it step by step, writing and editing files, running commands, and verifying its own output.

The catch? It runs in your terminal. That means it needs your laptop open, your terminal active, and your internet connection stable. Close the lid, lose WiFi, or accidentally close the tab, and your coding session is gone.

The better approach: run Claude Code on a cloud server that stays on 24/7. You connect when you need to, disconnect when you don't, and Claude Code keeps working regardless.

Here's how to set that up in a few minutes.


Why run Claude Code in the cloud?

Running Claude Code locally works fine for quick tasks. But for anything serious - long refactors, multi-file changes, complex debugging sessions - you want it running somewhere that doesn't depend on your laptop:

  • It keeps working when you disconnect. Close your laptop, go to lunch, come back - Claude Code is still going.
  • It's faster. Cloud servers have faster internet, more CPU, and more memory than most laptops. Package installs, builds, and git operations are quicker.
  • It's isolated. Claude Code runs arbitrary shell commands. On a cloud workspace, it can't accidentally mess up your local machine.
  • It's reproducible. Every workspace starts from a known state. No "works on my machine" surprises.
  • Multiple sessions. Run Claude Code on five different projects simultaneously, each in its own isolated workspace.

Setting it up

Step 1: Create a workspace

Go to the Oblien dashboard and create a new workspace:

  • Image: node-22 (includes Node.js, npm, and common dev tools)
  • CPU: 2-4 cores (Claude Code benefits from more CPU during builds)
  • Memory: 4-8 GB
  • Disk: 10-20 GB (enough for repos, node_modules, and build artifacts)

The workspace boots in about 130 milliseconds. It's a full Linux VM - own kernel, own disk, own network - not a shared container.

Step 2: Install Claude Code

Open the terminal in your workspace (from the dashboard - one click) and install Claude Code:

npm install -g @anthropic-ai/claude-code

Set your Anthropic API key:

export ANTHROPIC_API_KEY=sk-ant-your-key-here

For persistence across restarts, add it to your workspace's environment variables in the Settings tab.

Step 3: Clone your project

git clone https://github.com/your-org/your-project.git
cd your-project
npm install

Step 4: Start Claude Code

claude

That's it. Claude Code is now running in the cloud. You can interact with it through the terminal in the Oblien dashboard.


Keeping it alive when you disconnect

The key advantage of running in the cloud is persistence. Here are your options:

Option A: Use the built-in terminal

The Oblien dashboard's terminal maintains your session even if you close the browser tab and come back. Your shell environment, running processes, and Claude Code session stay alive.

Option B: Run as a workload

For long-running Claude Code sessions, create a managed workload:

Go to Workloads → Create Workload in the dashboard. Set the command to start Claude Code with your project path. Set the restart policy to "always."

Now Claude Code runs as a background service. View its output from the Logs tab. It survives workspace restarts and keeps running indefinitely.

Option C: Use SSH

Enable SSH on your workspace from the dashboard. Then connect from any machine:

ssh root@your-workspace-id -J root@ssh.oblien.com

No public IP needed, no VPN, no port forwarding. You SSH through Oblien's SSH gateway. Start a tmux session and Claude Code persists even when you disconnect SSH.


Giving Claude Code more power

Claude Code is most useful when it has access to a full development environment. Here's how to set that up:

Install your toolchain

Your workspace persists across restarts, so install once and forget:

# Python, Go, Rust, whatever you need
apt-get update && apt-get install -y python3 python3-pip golang

# Docker? Not needed - you're already in an isolated VM
# But if you need build tools:
apt-get install -y build-essential

Connect a database

If Claude Code needs to work with a database (migrating schemas, writing queries, debugging data issues), create a separate workspace running Postgres and connect them with a private link.

Your agent can now run SQL queries on a production-like database without exposing it to the internet. Only your Claude Code workspace can reach it.

Expose a dev server

Working on a web app? Claude Code starts a dev server, and you need to see it in your browser. Expose the port from the dashboard - you get an instant HTTPS preview URL.

https://abc123.preview.oblien.com

No ngrok, no tunnels, no firewall rules. Just click "Expose Port" in the dashboard.


Claude Code + other agents in the same project

Here's an advanced setup that's only practical when you can create isolated environments quickly:

Workspace 1: Claude Code - Your primary coding agent. It has full access to the repo and can read/write any file.

Workspace 2: Test runner - A separate workspace that Claude Code triggers to run tests. This isolates test execution from the main development environment. If a test does something weird (infinite loop, memory leak), it only affects the test workspace.

Workspace 3: Reviewer - Another AI agent (maybe OpenClaw or a custom LangChain agent) that reviews Claude Code's changes. It reads the diff, checks for issues, and reports back.

Each workspace is a separate microVM. They communicate over private links. If any one of them goes haywire, the others are unaffected.

This might sound complex, but it's just three workspaces connected with private networking. You can set it up in minutes from the dashboard.


Common questions

How much does this cost? Oblien has a free tier that's enough for trying this out. For serious use, workspaces cost based on CPU, memory, and disk usage - typically less than an equivalent EC2 instance because you only pay while the workspace is running.

Can I use Claude Code with VS Code? Yes. SSH into your workspace from VS Code (Remote - SSH extension), and you'll get the full VS Code experience with Claude Code running in the integrated terminal - but the compute is happening in the cloud.

What about my dotfiles and config? The workspace disk is persistent. Set up your .bashrc, .gitconfig, .ssh/keys once. They survive restarts and updates.

Can multiple people share a workspace? Each person should have their own workspace for isolation. But you can connect workspaces to shared resources (like a database or shared filesystem) using private links.

What if Claude Code needs internet access? Workspaces have internet access by default. Claude Code can install packages, clone repos, and call APIs. If you want to restrict what it can reach, configure egress rules to allowlist specific domains.


Summary

Running Claude Code in the cloud eliminates the biggest friction points: disconnect tolerance, speed, isolation, and reproducibility.

The setup takes about two minutes:

  1. Create a workspace (130ms boot)
  2. Install Claude Code (one command)
  3. Clone your project
  4. Start coding

Your laptop becomes optional. Your coding agent runs 24/7.

Try it free →