This site contains affiliate links. If you purchase through them I may earn a commission at no extra cost to you. Full disclosure.
The short answer: Yes, you should follow a short checklist before restarting OpenClaw after an update. Skipping it is a leading cause of avoidable downtime and configuration drift. This guide gives you the exact steps to run, commands to execute, and pitfalls to avoid.
"Updating OpenClaw is routine, but skipping pre-restart verification turns routine into firefighting. A consistent checklist makes deployments boring."
OpenClaw updates can change:
If you simply git pull and restart, you might encounter:
A short pre-restart checklist catches these issues before they affect your running automations.
~/.openclawtar -czf ~/backups/openclaw-$(date +%F).tar.gz -C ~/.openclaw .
Verify the file exists and is not zero bytes.
pm2 status openclaw
curl -f https://localhost:3000/health || echo "Health check fails"
Note any warnings in the logs that might need investigation later.
cd ~/openclaw
git fetch --tags
git checkout vX.Y.Z # or git pull if tracking main
npm ci --only=production
If npm ci fails due to engine mismatches, resolve before proceeding.
~/.openclaw/config.json with any new example config (often in repo as config.example.json). Add missing fields, but keep your secrets intact.
diff -u ~/.openclaw/config.json openclaw/config.example.json || true
node -e "require('./src/config')" 2>&1 | grep -i missing
Or simply start OpenClaw in the foreground to catch missing env errors:
npm start 2>&1 | head -100
PORT=3001 npm start &
Then test:
curl -f http://localhost:3001/health
curl -f http://localhost:3001/api/status
If the health endpoint returns 200, you're likely good.
Once the checklist is complete:
# If the old instance is still running under pm2
pm2 restart openclaw
pm2 save
# Verify it's up
pm2 status openclaw
sleep 2
curl -f https://your-domain/health
Watch the logs for a minute:
pm2 logs openclaw --lines 50
/health returns 200.pm2 logs for any agent errors.pm2 monit or curl -s http://localhost:3000/metrics if metrics are enabled.If something goes wrong:
cd ~/openclaw
git checkout previous-tag-or-commit
~/.openclaw from the backup you made:
tar -xzf ~/backups/openclaw-YYYY-MM-DD.tar.gz -C ~/.openclaw --overwrite
npm ci --only=production
pm2 restart openclaw
Practice this rollback at least once on a test VPS so you're confident when it counts.
Never update without a recent backup of ~/.openclaw. Even if the update itself fails, a misconfigured agent could delete or modify data. Backups are cheap insurance.
npm ci vs npm installUse npm ci, not npm install. npm ci strictly follows package-lock.json and ensures reproducible installs. npm install may update dependency ranges and introduce drift.
If you store env vars in multiple places (systemd service file, .env, shell profile), it's easy to miss one. Consolidate to a single .env file sourced by the pm2 startup script.
For production-critical deployments, clone your VPS (or use a separate Hostinger VPS) and run the update there first. It catches environment-specific issues before they affect live operations.
Need a reliable VPS to test updates safely? Hostinger's KVM VPS lets you spin up a staging instance in minutes. Test updates there before production, and keep your main deployment running smoothly.
~/.openclaw directory. That's where agent definitions, credentials, and configuration live. If the update breaks something, you can restore quickly.npm ci --only=production after pulling new code to ensure dependencies match package-lock.json. Skipping this leads to missing modules or version mismatches.pm2 start npm --name openclaw-test -- start -- --test or set up a staging environment on a separate VPS. Test critical agents with sample data before switching over.pm2 restart openclaw and monitor logs.pm2 logs openclaw. Common causes: missing API keys, changed config schema, or network changes. If needed, restore the backup and revert the git commit. Keep the previous version available.