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 cadenceMonthly
  • Backups~/searxng-backups
  • Servicesearxng.service
01

Update monthly

SearXNG fixes engine scrapers and ships dependency patches. Update sooner if one engine stops returning results.

02

Back up first

The update script creates a backup automatically. Take one before manual edits to settings.yml or openclaw.json.

03

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:

  1. Creates a configuration backup.
  2. Fetches and fast-forwards the current SearXNG branch (upstream uses master).
  3. Reinstalls the editable Python package.
  4. Restarts searxng.service.
  5. 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
Watch for settings drift.

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.toml if present
  • /etc/systemd/system/searxng.service
  • ~/.openclaw/openclaw.json if present
  • restore.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.

Backups contain secrets.

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.

TaskCommand
SearXNG statesudo systemctl status searxng --no-pager
Redisredis-cli ping
SearXNG logssudo journalctl -u searxng -f
SearXNG logs, last 100sudo journalctl -u searxng -n 100 --no-pager
OpenClaw gatewaysystemctl --user status openclaw-gateway.service --no-pager
OpenClaw logsjournalctl --user -u openclaw-gateway.service -f
OpenClaw config checkopenclaw doctor
API checkcurl -s "http://127.0.0.1:8080/search?q=test&format=json" | jq '.results | length'
Failed enginescurl -s "http://127.0.0.1:8080/search?q=test&format=json" | jq '.unresponsive_engines'
Full suitebash 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.

WhenAction
After every config changeRestart, run the API check, run test-setup.sh
Monthlysudo bash scripts/update-searxng.sh
Before updates or editsbash scripts/backup-searxng.sh
QuarterlyReview enabled engines, logs, disk use, and backup restore once
When an engine breaksUpdate 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.

It removes data.

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