Self-host SearXNG: private metasearch and free web search for Open WebUI and LobeHub
Deploy SearXNG on your own server with Zenavo's template, enable its JSON API, and connect it to Open WebUI and LobeHub over the project private network so your AI models can search the live web with zero per-query fees.
This post is also available in 简体中文, 繁體中文, 日本語, Español and Bahasa Indonesia.
Once you have Open WebUI or LobeHub running, the next question is almost always the same: how do I let models look up today's news, current documentation or live web pages? Commercial search APIs (Tavily, Serper, Brave Search) charge per query, while public SearXNG instances rate-limit automated requests.
SearXNG is an open-source metasearch engine: instead of maintaining its own index, it queries dozens of engines (Google, Bing, DuckDuckGo, Wikipedia, GitHub and more) in parallel, deduplicates the results, and strips out tracking profiles. Better yet, when you drop SearXNG into the same Zenavo project as Open WebUI or LobeHub, your chat app can query it over the private network with zero per-search fees.
1. Two ways to deploy: private backend or personal search engine
First connect a Linux server to Zenavo, then pick the setup that matches how you'll use it:
- Option A: Internal web-search backend for Open WebUI or LobeHub (recommended)
Open your existing Open WebUI or LobeHub project in Zenavo, click Add Service → Templates, and choose SearXNG. SearXNG then runs inside the same project network (
http://searxng.zenavo.internal:8080) and doesn't even need a public domain, so nobody outside your project can hit your search endpoint. - Option B: Standalone private search engine for your browser
Deploy a new project from the SearXNG template, then bind a custom domain (such as
search.example.com) to port8080on thesearxngservice's Networking tab. See Domains & HTTPS.
The template is very lightweight (typically under 200 MB of memory):
| Setting | Value or purpose |
|---|---|
| Image | searxng/searxng:latest |
| HTTP port | 8080 |
| Config volume | /etc/searxng (generates settings.yml and limiter.toml on first boot) |
| Cache volume | /var/cache/searxng |
SEARXNG_SECRET |
Random secret generated when the project is created |
2. Enable the JSON format (required for AI tools)
By default, SearXNG only serves HTML pages for browsers and returns 403 Forbidden when a client requests ?format=json. Open WebUI and LobeHub both fetch search results via the JSON API.
After the service boots for the first time and populates /etc/searxng/settings.yml, open /etc/searxng/settings.yml (via the container terminal or config files) and add json under search.formats:
search:
formats:
- html
- json
If SearXNG is only called over the Zenavo private network, also verify that limiter: false is set under server: so internal requests without public proxy headers aren't throttled. Save the file and click Restart on the searxng service.
3. Connect Open WebUI
If you deployed Open WebUI:
- Sign in to Open WebUI as an admin and open Admin Panel → Settings → Web Search.
- Toggle Enable Web Search on.
- Set Web Search Engine to
searxng. - Set Searxng Query URL to:
- Same Zenavo project (private network):
http://searxng.zenavo.internal:8080/search?q=<query> - Separate project (public domain):
https://search.example.com/search?q=<query>
- Same Zenavo project (private network):
- Click Save. In a new chat, toggle Web Search below the prompt box and ask about a recent event to watch it retrieve live pages before answering.
4. Connect LobeHub
If you run LobeHub, add these environment variables on the lobehub service's Variable tab, then save and restart lobehub:
SEARCH_PROVIDERS=searxng
SEARXNG_URL=http://searxng.zenavo.internal:8080
(If SearXNG is in a different project, set SEARXNG_URL to your https://search.example.com domain.) Once restarted, LobeHub's built-in web search plugin queries your SearXNG instance automatically.
5. Backups and upgrades
SearXNG stores no user accounts or chat history — only your customized /etc/searxng/settings.yml matters:
- After editing
settings.yml, either keep a copy of the file or back up the/etc/searxngvolume from the Backup & Restore tab during a maintenance window. - The template uses
searxng/searxng:latestbecause upstream search engines frequently tweak their HTML markup and SearXNG ships parser fixes regularly. If you want to lock a specific version, change the tag under Settings → Source.
FAQ
Open WebUI or LobeHub gets 403 Forbidden when searching.
Almost always because json hasn't been added under search.formats in /etc/searxng/settings.yml (step 2), or the searxng service wasn't restarted after editing the file. Also prefer the private network URL (http://searxng.zenavo.internal:8080) over a public domain protected by bot rules.
Why does Google occasionally time out or ask for a CAPTCHA?
Data-center IP addresses can hit upstream rate limits if every query goes to a single search engine. Enable multiple engines (Bing, DuckDuckGo, Brave, Wikipedia) in SearXNG's Preferences → Engines or in settings.yml so SearXNG spreads queries across sources.
If I bind a public domain, how do I stop strangers from abusing my JSON API?
If SearXNG is only for Open WebUI or LobeHub, don't bind a public domain at all — keep it on .zenavo.internal private networking. If you also use it in your browser, enable server.limiter: true in settings.yml or keep the JSON format restricted to internal services.
Can I run SearXNG alongside a self-hosted model gateway? Yes. A popular setup runs Open WebUI / LobeHub + SearXNG + Magpie (or New API / LiteLLM) inside one Zenavo project so chat UI, live web search and model routing all communicate over the internal network on a single server.
Deploy the SearXNG template — or add it straight into your existing AI project — to give your models private, zero-per-query web search in minutes.
This is what coding agents read, at https://zenavo.app/blog/self-host-searxng.md.
Could not load the Markdown. Open it directly: https://zenavo.app/blog/self-host-searxng.md