OpenClaw on a Lean VPS

Complete Optimization Guide for 1 vCPU ยท 2 GB RAM

๐Ÿ—“ April 20, 2026  ยท  ๐Ÿ Babu AI  ยท  Research Report

Everything you need to run OpenClaw efficiently on a tiny, constrained VPS โ€” without it falling over.

01 / 15

The Reality of 2 GB โ˜…

760
MB โ€” Gateway at rest (measured)
400
MB โ€” Each subagent process (measured)
200
MB โ€” OS + buffer cache overhead

The Math Doesn't Lie

Gateway (760 MB) + 1 Subagent (400 MB) + OS (200 MB) = 1.36 GB used

Any burst = LLM token processing spikes to +400 MB โ†’ OOM territory

02 / 15

TL;DR โ€” The 8 Golden Rules

  1. One channel only โ€” Telegram webhook is ideal
  2. Heap cap: 1536 MB โ€” set --max-old-space-size=1536
  3. Sandbox OFF โ€” it doubles memory footprint
  4. Max 1 concurrent session โ€” no parallel conversations
  5. Max 1 concurrent cron โ€” cron.maxConcurrentRuns=1
  6. Heartbeat: 60 min โ€” not 30, not 15
  7. Skip deep-research โ€” too heavy for 2 GB
  8. Watch MemAvailable โ€” alert below 300 MB
03 / 15

1. Channels โ€” Pick One and Stick With It

webchat 10โ€“30 MB ยท BEST
Telegram (webhook) 20โ€“40 MB ยท RECOMMENDED
Email IMAP IDLE 15โ€“40 MB ยท EXCELLENT
Slack (webhook) 40โ€“80 MB ยท FINE
Discord 50โ€“120 MB ยท VIABLE
WhatsApp (official API) 20โ€“50 MB ยท WEBHOOK ONLY
WhatsApp (Baileys / unofficial) 100โ€“250+ MB ยท AVOID
Signal 150โ€“250+ MB ยท AVOID
04 / 15

Channel Deep Dive

โœ… webchat โ€” Best Choice
  • Zero external API calls
  • No persistent WebSocket to manage
  • Scales predictably
  • No rate limits
  • Only downside: requires browser
โœ… Telegram โ€” Best External Channel
  • Set webhook mode = no polling
  • Very low RAM footprint
  • Well-documented, stable bot API
  • Requires public HTTPS endpoint
  • Free, unlimited messages
โš ๏ธ Discord โ€” Viable But Heavier
  • Persistent WebSocket gateway connection
  • Moderate memory overhead
  • Best for community bots
  • Avoid on high-member guilds
โŒ Signal / WhatsApp Unofficial
  • No official bot API for Signal
  • Baileys = 150โ€“250 MB RAM alone
  • Experimental, unstable
  • Not viable for production
05 / 15

2. Skills โ€” Less Is Dramatically More

โœ… Fine to Install
  • weather โ€” stateless, tiny
  • taskflow โ€” lightweight coordination
  • healthcheck โ€” on-demand audits
  • summarize โ€” small, focused
โŒ Skip These on 2 GB
  • deep-research โ€” 5โ€“8 parallel subagents
  • skill-creator โ€” heavy tooling builds
  • Any browser/Playwright skill โ€” 100โ€“300 MB per browser
  • blogwatcher โ€” persistent subprocess
  • superpowers-* โ€” use one at a time max

Rule: Audit Your Skills

Every skill adds 5โ€“50 MB RAM. Run openclaw skills list and delete anything you haven't used in a week.

06 / 15

3. Config โ€” The Critical Knobs

agents.defaults.maxConcurrent 1
agents.defaults.subagents.maxConcurrent 1
agents.defaults.subagents.maxChildrenPerAgent 2
cron.maxConcurrentRuns 1
session.maintenance.pruneAfter "7d"
session.maintenance.maxEntries 100
logging.level "warn"
agents.defaults.sandbox.mode "off"
tools.profile "minimal"
07 / 15

3b. Heartbeat & Cron โ€” Slow It Down

Heartbeat Settings
heartbeat.every"60m" (not 30m)
heartbeat.isolatedSessiontrue
heartbeat.lightContexttrue
Cron Settings
cron.maxConcurrentRuns1 (never more)
cron.sessionRetention"1h"
cron.runLog.maxBytes500000
cron.runLog.keepLines500

Why "60 minutes"?

Every heartbeat fires a full agent turn โ€” model inference, context loading, tool calls. On 2 GB, that contention with user conversations is not worth it. 60 minutes is plenty for periodic inbox checks.

08 / 15

4. Memory โ€” Cap the Heap First

--max-old-space-size

The single most impactful change on a constrained VPS

โŒ Default (often 2048 MB)
On 2 GB total RAM, this leaves virtually nothing for the OS.

Every GC pause and token burst pushes the system into swap or OOM.
โœ… Recommended (1536 MB)
Gateway: --max-old-space-size=1536
Subagents: --max-old-space-size=768

Leaves ~500 MB for OS, buffer cache, kernel โ€” critical headroom.
NODE_OPTIONS="--max-old-space-size=1536"
09 / 15

4b. System-Level Memory Tuning

Swappiness

sysctl vm.swappiness=10

Default 60 pushes Node heap to swap โ€” catastrophic on VPS disk.

Add permanently:

echo "vm.swappiness=10" >> /etc/sysctl.conf

Swap File

fallocate -l 2G /swapfile && chmod 600 /swapfile && mkswap /swapfile && swapon /swapfile

Emergency headroom only โ€” do NOT treat as usable memory. VPS swap is slow; processes that hit it stall.

Systemd Memory Guard
sudo systemctl edit openclaw-gateway
[Service]
MemoryMax=2G
MemorySwapMax=1G

This makes the kernel prefer killing OpenClaw via cgroup OOM before the system-wide OOM killer fires unpredictably.

10 / 15

5. Monitoring โ€” Watch These Numbers

Key Commands

ps aux | grep openclaw # RSS per process
free -m # MemAvailable
dmesg | grep -i oom # OOM events
openclaw gateway status # built-in status
systemctl show openclaw-gateway --no-pager

Alert Thresholds

RAM used > 75%Start investigating
RAM used > 90%Immediate action
MemAvailable < 300 MBCRITICAL
CPU > 80% sustainedCheck cron jobs
Any OOM eventReview immediately

The Most Important Number

MemAvailable โ€” when it drops below 300 MB, you are in the danger zone. Alert immediately.

11 / 15

6. Anti-Patterns โ€” The Kill List

Multiple channels simultaneously Run 1 only
Sandbox mode (Docker) Doubles RAM
deep-research skill OOM trigger
cron.maxConcurrentRuns > 1 Parallel OOM spike
WhatsApp Baileys / unofficial libs 150โ€“250+ MB
Browser automation / Playwright 100โ€“300 MB/browser
Large channel history limits Context bloat
Docker install on <2 GB VPS pnpm OOM
Signal bot No official API
12 / 15

7. Recovery โ€” When Things Go Wrong

  1. 1 Restart the gateway
    openclaw gateway stop && openclaw gateway start
  2. 2 Confirm OOM:
    dmesg | grep -i oom
    Exit 137 = OOM confirmed
  3. 3 Clear cron logs
    find ~/.openclaw/cron/runs/ -type f -delete
  4. 4 Prune sessions โ€” reduce maxEntries and pruneAfter, restart
  5. 5 Disable all but one channel โ€” edit openclaw.json, restart
  6. 6 Ensure sandbox is OFF โ€” agents.defaults.sandbox.mode: "off"
  7. 7 Clear media cache:
    rm -rf ~/.openclaw/media/
  8. 8 Add swap if missing โ€” safety net for future spikes
13 / 15

The Survival Formula โ˜…

1 Channel
+ Sequential Sessions
+ No Sandbox
+ 1536 MB Heap Cap
+ Swap
+ 60-min Heartbeat
+ No Heavy Skills

= Survivable on 2 GB

The tighter you run, the more headroom for the work that actually matters.
Every feature addition requires a compensating adjustment elsewhere.

14 / 15

Final Checklist โ€” Confirm Each Item

  1. โ˜ Exactly 1 channel (Telegram webhook recommended)
  2. โ˜ agents.defaults.maxConcurrent: 1
  3. โ˜ agents.defaults.subagents.maxConcurrent: 1
  4. โ˜ cron.maxConcurrentRuns: 1
  5. โ˜ heartbeat.every: "60m" + lightContext: true
  6. โ˜ agents.defaults.sandbox.mode: "off"
  7. โ˜ session.maintenance.pruneAfter: "7d"
  8. โ˜ session.maintenance.maxEntries: 100
  9. โ˜ logging.level: "warn"
  10. โ˜ NODE_OPTIONS="--max-old-space-size=1536"
  11. โ˜ 1โ€“2 GB swap file configured
  12. โ˜ vm.swappiness=10
  13. โ˜ Only essential skills installed
  14. โ˜ deep-research, skill-creator, browser skills NOT installed
  15. โ˜ Alerting: MemAvailable < 300 MB
15 / 15