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
- One channel only โ Telegram webhook is ideal
- Heap cap: 1536 MB โ set
--max-old-space-size=1536
- Sandbox OFF โ it doubles memory footprint
- Max 1 concurrent session โ no parallel conversations
- Max 1 concurrent cron โ
cron.maxConcurrentRuns=1
- Heartbeat: 60 min โ not 30, not 15
- Skip deep-research โ too heavy for 2 GB
- 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
Restart the gateway
openclaw gateway stop && openclaw gateway start
-
2
Confirm OOM:
dmesg | grep -i oom
Exit 137 = OOM confirmed
-
3
Clear cron logs
find ~/.openclaw/cron/runs/ -type f -delete
-
4
Prune sessions โ reduce
maxEntries and pruneAfter, restart
-
5
Disable all but one channel โ edit openclaw.json, restart
-
6
Ensure sandbox is OFF โ
agents.defaults.sandbox.mode: "off"
-
7
Clear media cache:
rm -rf ~/.openclaw/media/
-
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
- โ Exactly 1 channel (Telegram webhook recommended)
- โ
agents.defaults.maxConcurrent: 1
- โ
agents.defaults.subagents.maxConcurrent: 1
- โ
cron.maxConcurrentRuns: 1
- โ
heartbeat.every: "60m" + lightContext: true
- โ
agents.defaults.sandbox.mode: "off"
- โ
session.maintenance.pruneAfter: "7d"
- โ
session.maintenance.maxEntries: 100
- โ
logging.level: "warn"
- โ
NODE_OPTIONS="--max-old-space-size=1536"
- โ 1โ2 GB swap file configured
- โ
vm.swappiness=10
- โ Only essential skills installed
- โ deep-research, skill-creator, browser skills NOT installed
- โ Alerting: MemAvailable < 300 MB
15 / 15