Web Search Setup Guide for Open WebUI
This guide will add internet search capabilities to your Open WebUI installation. Your AI will be able to search the web in real-time to answer questions about current events, news, and information beyond its training data.
Open your terminal and run:
mkdir searxng-setup
cd searxng-setup
Create a new file called docker-compose.yml:
nano docker-compose.yml
Paste the following configuration:
services:
searxng:
container_name: searxng
image: searxng/searxng:latest
ports:
- "8080:8080"
volumes:
- ./searxng:/etc/searxng:rw
environment:
- SEARXNG_HOSTNAME=localhost:8080/
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "1"
Save the file:
Ctrl + XY to confirmEnter to saveStart the container briefly to create the configuration files:
docker compose up -d
sleep 10
docker compose down
Open WebUI needs JSON format support to communicate with SearXNG. Edit the settings file:
sudo nano searxng/settings.yml
Find this section (around line 64):
search:
# formats: [html, csv, json, rss]
formats:
- html
Change it to:
search:
# formats: [html, csv, json, rss]
formats:
- html
- json
Important: Make sure - json is indented with exactly 4 spaces (same as - html).
Save the file:
Ctrl + XYEnterStart the SearXNG container:
docker compose up -d
Wait a few seconds, then test:
sleep 5
curl "http://localhost:8080/search?q=test&format=json"
curl "http://100.87.1.24:8888/search?q=test&format=json"
You should see JSON output with search results. If you see HTML or an error, go back to Step 4 and verify the JSON format was added correctly.
http://localhost:3000)Set the following options:
Searxng Query URL: Enter one of the following:
http://searxng:8080/search?q=<query>
(If this doesn't work, try: http://host.docker.internal:8080/search?q=<query>)
Search Result Count: Set to 3 (or your preference)
Concurrent Requests: Set to 10 (or your preference)
Scroll to the bottom and click Save.
+ button next to the message input field at the bottom+ button to reveal additional options⚠️ Web Search must be enabled manually for each chat session
Once Web Search is enabled, try asking:
Check logs:
docker logs searxng
Common issue: YAML syntax error in settings.yml
- json line is indented exactly like - html (4 spaces)Checklist:
docker ps+ button)?From Open WebUI container:
docker exec -it open-webui curl "http://searxng:8080/search?q=test&format=json"
If this fails, try changing the URL in Open WebUI settings to:
http://host.docker.internal:8080/search?q=<query>
This means JSON format is not enabled. Go back to Step 4 and verify:
- json line exists under formats:- html)docker logs searxng
cd searxng-setup
docker compose restart
cd searxng-setup
docker compose down
cd searxng-setup
docker compose pull
docker compose up -d
SearXNG is a privacy-respecting metasearch engine that queries multiple search engines (Google, Bing, DuckDuckGo, etc.) and aggregates the results. It doesn't track users or store search history.
cd searxng-setup
docker compose down
sudo rm -rf searxng/
docker compose up -d
sleep 10
docker compose down
# Edit searxng/settings.yml to add JSON support
docker compose up -d
+ buttonhttp://searxng:8080/search?q=<query>http://host.docker.internal:8080/search?q=<query>http://172.17.0.1:8080/search?q=<query>If you continue to experience issues:
docker logs searxngdocker ps | grep searxngcurl "http://localhost:8080/search?q=test&format=json"Setup Complete! 🎉
You now have web search capabilities in your Open WebUI installation. Remember to toggle Web Search ON in each chat session when you need it.