Maintenance
Update, back up, inspect, remove.
The deployment is small enough to maintain by hand. The scripts still wrap the
parts that are easy to get wrong: pulling the right branch, keeping backups out
of /root, and restarting in the right order.
Update monthly
SearXNG fixes engine scrapers and ships dependency patches. Update sooner if one engine stops returning results.
Back up first
The update script creates a backup automatically. Take one before manual edits to settings.yml or openclaw.json.
Test after changes
Run the test suite after updates, port changes, firewall changes, or plugin changes.
Update
Pull the branch that is actually checked out.
sudo bash scripts/update-searxng.sh
The script:
- Creates a configuration backup.
- Fetches and fast-forwards the current SearXNG branch (upstream uses
master). - Reinstalls the editable Python package.
- Restarts
searxng.service. - Checks the service and JSON API.
The script does not roll back automatically. If the service fails after an update, restore the backup from the path printed by the script.
Equivalent manual update:
sudo -u searxng -i
cd /usr/local/searxng/searxng-src
git branch --show-current
git pull --ff-only
source /usr/local/searxng/searx-pyenv/bin/activate
pip install --use-pep517 --no-build-isolation -e .
exit
sudo systemctl restart searxng
sudo systemctl status searxng --no-pager
SearXNG settings keys can change between versions. If a key is rejected after an update, compare your file with the version's template in utils/templates/etc/searxng/.
Backup and restore
One archive, including a restore helper.
bash scripts/backup-searxng.sh
Output:
~/searxng-backups/searxng-backup-YYYYMMDD-HHMMSS.tar.gz
The archive contains:
/etc/searxng/settings.yml/etc/searxng/limiter.tomlif present/etc/systemd/system/searxng.service~/.openclaw/openclaw.jsonif presentrestore.sh
When the script is run through sudo, it resolves the invoking user's home through SUDO_USER, so archives do not land in /root.
Restore:
cd ~/searxng-backups
tar -xzf searxng-backup-YYYYMMDD-HHMMSS.tar.gz
cd YYYYMMDD-HHMMSS
bash restore.sh
Run restore.sh as your user, not with sudo. It calls sudo for system files and restarts both services.
They can include the OpenClaw config and Redis credentials. Restrict permissions and never attach an unredacted archive to an issue.
Status and logs
Useful commands, in the order you will need them.
| Task | Command |
|---|---|
| SearXNG state | sudo systemctl status searxng --no-pager |
| Redis | redis-cli ping |
| SearXNG logs | sudo journalctl -u searxng -f |
| SearXNG logs, last 100 | sudo journalctl -u searxng -n 100 --no-pager |
| OpenClaw gateway | systemctl --user status openclaw-gateway.service --no-pager |
| OpenClaw logs | journalctl --user -u openclaw-gateway.service -f |
| OpenClaw config check | openclaw doctor |
| API check | curl -s "http://127.0.0.1:8080/search?q=test&format=json" | jq '.results | length' |
| Failed engines | curl -s "http://127.0.0.1:8080/search?q=test&format=json" | jq '.unresponsive_engines' |
| Full suite | bash scripts/test-setup.sh |
Restart
Restart in the right order.
# SearXNG after a settings change
sudo systemctl restart searxng
# Redis after a config change
sudo systemctl restart redis-server
# If both changed, Redis first
sudo systemctl restart redis-server
sudo systemctl restart searxng
# OpenClaw after a plugin/config change
systemctl --user restart openclaw-gateway.service
sleep 5
openclaw doctor 2>&1 | grep -i searxng
Restart the OpenClaw gateway as its owner. Running systemctl --user under sudo targets root's user manager, not yours.
Suggested schedule
Low-effort maintenance that prevents surprises.
| When | Action |
|---|---|
| After every config change | Restart, run the API check, run test-setup.sh |
| Monthly | sudo bash scripts/update-searxng.sh |
| Before updates or edits | bash scripts/backup-searxng.sh |
| Quarterly | Review enabled engines, logs, disk use, and backup restore once |
| When an engine breaks | Update SearXNG, then disable the engine if it still fails |
There is no bundled timer for updates or backups. Add a systemd timer or cron job if you want automation; the scripts are safe to call from a scheduler. Test the first run manually.
Uninstall
Remove the service, the user, and the files.
sudo bash scripts/uninstall.sh
The script asks for confirmation, stops and disables the service, removes the unit, deletes the searxng user and directories, and optionally removes Redis and the OpenClaw plugin block.
Back up first if you want to keep the configuration. The script leaves the repository checkout in place; delete it manually if you no longer need it.
bash scripts/backup-searxng.sh
sudo bash scripts/uninstall.sh