OpenClaw Backup &
Recovery Guide
What to back up, how often, and exactly how to restore your OpenClaw agent after a server failure — without losing conversation history or workspace data.
The Three Critical Directories
OpenClaw stores all stateful data in three locations. Back up these — everything else is recreatable from scratch.
| Path | What’s Inside | Size | Backup Frequency |
|---|---|---|---|
~/openclaw/data/.openclaw/ | Conversation history, memory, workspace state, channel sessions | 50–500 MB | Daily |
~/openclaw/.env | API keys, gateway token, all configuration | <5 KB | Every change |
~/openclaw/docker-compose.yml | Container configuration | <2 KB | Every change |
Your .env file contains API keys worth real money. Never store it in plain text in a public cloud location. Encrypt it before uploading: gpg --symmetric .env creates .env.gpg — upload only the encrypted version.
Set Up Daily Automated Backups
Local backups don’t protect you if your VPS provider has a data centre incident. Use rclone to sync backups to a free cloud storage provider (Backblaze B2, Cloudflare R2, or even Google Drive) after each backup run.
How to Restore After a Server Failure
- 1
Provision a new VPS
Same specs or better. Ubuntu 22.04 LTS. Install Docker following the installation guide.
- 2
Deploy fresh OpenClaw
Clone your docker-compose.yml to the new server and run
docker compose pull. - 3
Restore your backup archive
scp openclaw-backups/openclaw-LATEST.tar.gz user@NEW_SERVER:~/ ssh user@NEW_SERVER mkdir -p ~/openclaw && cd ~/ tar -xzf openclaw-LATEST.tar.gz - 4
Start OpenClaw
cd ~/openclaw && docker compose up -d - 5
Verify data integrity
Message your agent on Telegram/WhatsApp. It should remember your previous conversations and have all skills intact.
Backups In Place
With automated backups and a recovery plan, you’re protected against the worst-case scenarios.
Set Up Monitoring →Migration Guide
