Phuriwaj

Running Cowork / Claude Code on a Cloud VM for Always-On Scheduling

How to move Claude Code scheduled tasks off a local Windows PC onto a persistent cloud VM so tasks fire reliably without needing to leave a laptop running.

Why / When to Use

Cowork desktop app and Claude Code both require the host machine to be on, not sleeping, and logged in for scheduled tasks to execute. On a Windows laptop this means:

  • Scheduled tasks silently fail if the machine sleeps
  • You need to keep the PC on 24/7
  • Wake timers are unreliable on modern hardware

A cloud VM sidesteps all of this.

Core Concept / Commands

Option 1 β€” Disable sleep (quick fix, local machine)

Control Panel β†’ Power Options β†’ Change plan settings β†’ Never (Sleep/Hibernate)

Leaves machine running 24/7. Simple but increases power consumption and hardware wear.

Option 2 β€” Windows Wake Timers (fiddly)

Control Panel β†’ Power Options β†’ Change advanced settings β†’ Sleep β†’ Allow wake timers β†’ Enable

Then create a Windows Scheduled Task with a β€œWake the computer to run this task” trigger. Unreliable on modern laptops β€” sleep/wake cycle can interfere with running processes.

Provision a cheap Linux VPS. Claude Code runs perfectly headless on Linux with no GUI required.

Recommended providers:

ProviderCheapest tierNotes
Hetzner~€4/month (CX22, 2 vCPU, 4 GB RAM)Fastest EU option, very reliable
DigitalOcean~$6/month (Basic Droplet, 1 vCPU, 1 GB RAM)Easy UX, wide region choice
Vultr~$5/monthSimilar to DigitalOcean

Basic setup:

# 1. Provision Ubuntu 22.04 LTS
# 2. SSH in
ssh root@<your-vps-ip>
 
# 3. Install Node.js (required for Claude Code)
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
 
# 4. Install Claude Code CLI
npm install -g @anthropic/claude-code
 
# 5. Authenticate
claude login
 
# 6. Set up cron for scheduled tasks (example: 5 PM UTC+7 = 10 AM UTC)
crontab -e
# 0 10 * * 1-5  cd /home/user/workspace && claude run --prompt "run daily PKM"

Key Options / Variants

  • tmux / screen β€” keep Claude Code sessions alive across SSH disconnections:
    tmux new-session -s pkm
    # run claude code inside tmux
    # detach: Ctrl+B, D
  • systemd timer β€” more robust than cron for complex schedules; logs to journald

Gotchas

  • Claude Code authentication tokens expire; store the token securely and handle re-auth in your startup scripts
  • Outbound network access is required for Claude.ai API calls β€” check VM firewall rules
  • Cowork desktop app (GUI) cannot run on a headless VM β€” Claude Code CLI is the correct tool for cloud deployments
  • SSH key authentication preferred over password for security

Source

Conversation β€œUsing Claude desktop on multiple computers” β€” 2026-05-22