Managing Your OpenClaw Workspace When Hosted on a VPS
Hosting OpenClaw on a VPS is great for always-on agents, but how do you manage configs and workspace files from your local machine? This guide covers the best approaches, from simple to advanced.
The Challenge
When you run OpenClaw on a remote VPS, you need a way to:
- Edit configuration (
~/.openclaw/openclaw.json) - Manage workspace files (
AGENTS.md,SOUL.md,USER.md,MEMORY.md) - Track changes over time
- Backup important state
Option 1: VS Code Remote SSH (Recommended)
The cleanest approach is to edit files directly on the VPS using VS Code's Remote SSH extension.
Setup:
- Install the "Remote - SSH" extension in VS Code
- Add your VPS to
~/.ssh/config:Host my-vps HostName your-vps-ip User your-username IdentityFile ~/.ssh/your-key - Connect via the Remote Explorer panel
- Open
~/.openclaw/as your workspace
Why this works well:
- No sync conflicts
- Full VS Code features (syntax highlighting, git integration)
- Edit config and workspace in one place
Option 2: SFTP Client (GUI-Based)
If you prefer a graphical file manager:
- macOS: Cyberduck or ForkLift
- Windows: WinSCP
- Linux: Most file managers support
sftp://user@host
Connect over SSH and browse/edit ~/.openclaw/ like a local folder.
Option 3: rsync (Terminal-Based Sync)
For backups or batch syncing:
# Pull workspace to local machine
rsync -avz user@your-vps:~/.openclaw/workspace/ ./openclaw-backup/
# Push changes back
rsync -avz ./openclaw-backup/ user@your-vps:~/.openclaw/workspace/Important: Stop the gateway before syncing state files to avoid corruption:
openclaw gateway stop
# sync/edit
openclaw gateway startOption 4: sshfs Mount (Mount as Local Folder)
On Linux (especially Arch), you can mount the VPS folder locally:
# Install dependencies
sudo pacman -S openssh sshfs fuse3
# Create mount point
mkdir -p ~/mnt/openclaw-workspace
# Mount workspace
sshfs user@your-vps:~/.openclaw/workspace ~/mnt/openclaw-workspace \
-o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,compression=yes
# Unmount when done
fusermount3 -u ~/mnt/openclaw-workspaceBest Practice: Version Control Your Workspace
The workspace directory (~/.openclaw/workspace/) contains your agent's personality and memory files. Put it in a private git repo:
- Initialize git in the workspace (on the VPS)
- Commit changes as you iterate on
SOUL.md,AGENTS.md, etc. - Push to a private remote for history, diffs, and rollbacks
Don't git-commit the entire ~/.openclaw/ directory - it contains credentials, sessions, and auth profiles. Back these up separately (encrypted rsync) but don't treat them like code.
Quick Reference
| Method | Best For | Complexity |
|---|---|---|
| VS Code Remote SSH | Daily editing | Low |
| SFTP Client | Quick file access | Low |
| rsync | Backups/batch sync | Medium |
| sshfs | Local folder feel | Medium |
Credit: This guide was synthesized from a helpful discussion in the OpenClaw Discord #help channel.
Comments (0)
No comments yet. Be the first to comment!