This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
OpenClaw on Proxmox is a single-script deployment tool (setup-openclaw-lxc.sh) that automates creating a Proxmox LXC container with a fully configured OpenClaw AI assistant, LXQt desktop, Google Chrome, and VNC/noVNC remote access. It targets Proxmox VE 8.x+ hosts running as root.
The entire project is one ~460-line Bash script with this flow:
- Pre-flight — Verify Proxmox CLI tools (
pct,pvesh,pveam) and root access - User prompts — Collect container password, disk/memory/CPU/resolution settings
- Auto-detection — Find next VMID and storage backends via
pveshJSON + Python parsing - Template management — Download Debian 13 template if missing
- Container creation — Privileged LXC, DHCP networking
- Package installation — Node.js 22, Homebrew (as non-root
brewuser), OpenClaw (npm global), LXQt, TigerVNC, noVNC, Google Chrome, OpenClaw browser extension - Configuration — OpenClaw gateway settings, VNC password/xstartup, noVNC auto-scaling patch, Chrome as default browser
- Desktop integration — Desktop shortcuts for onboarding wizard and dashboard
- Systemd services — Three auto-starting services:
openclaw-gateway(port 18789),vncserver(:1/5901),novnc(port 6080) - Verification — Check all services are active, print connection info
Key helper: ct_exec() wraps pct exec $VMID -- bash -c for all in-container commands.
- No build system, test suite, or linter — this is a standalone Bash script
- Uses
set -euo pipefailfor strict error handling - All in-container operations use heredoc-embedded config files (systemd units, desktop files, wrapper scripts)
- Colorized output via
info(),ok(),warn(),err(),fatal()helper functions - Homebrew is installed under a dedicated
brewuseraccount (non-root requirement) with a symlink at/usr/local/bin/brewfor root access - The noVNC auto-scaling patch modifies
/usr/share/novnc/app/ui.jsin-place viased - Auth token is generated with
openssl rand -hex 16
There is no automated test infrastructure. To test changes, run the script on a Proxmox host:
bash setup-openclaw-lxc.shVerify by checking: container creation, all three systemd services running, noVNC web access, and OpenClaw dashboard reachability.
- Bash with
set -euo pipefail - Double-quoted variables throughout
- Heredocs for multi-line content (both quoted
'EOF'and unquotedEOFdepending on variable expansion needs) grep -vto suppress noisy apt/install output- Python3 one-liners for JSON parsing of Proxmox API output