SearXNG
SearXNG is a free, privacy-respecting metasearch engine that aggregates results from multiple search engines without tracking you. It's a self-hosted alternative to Google that protects your privacy.
Why SearXNG?
No Tracking: Doesn't store search queries or user data
No Profiling: Can't build a profile of your interests
Aggregated Results: Combines results from multiple sources
Customizable: Choose which search engines to use
Ad-Free: No advertisements or sponsored results
Open Source: Transparent, auditable code
How It Works
SearXNG acts as a proxy between you and search engines:
You → SearXNG → Multiple Search Engines → SearXNG → You
Search engines see SearXNG's IP, not yours. Your queries are mixed with others, making tracking impossible.
Features
Search Categories
- General web search
- Images
- Videos
- News
- Maps
- Music
- Files
- Science (academic papers)
- IT (Stack Overflow, GitHub, etc.)
Supported Engines
- Bing
- DuckDuckGo
- Qwant
- Brave Search
- Wikipedia
- YouTube
- GitHub
- Stack Overflow
- And 70+ more
Privacy Features
- No cookies required
- No JavaScript required (optional)
- No user tracking
- No search history
- Tor support
- Proxy support
Installation with Docker
Basic Setup
version: '3.8'
services:
searxng:
image: searxng/searxng:latest
container_name: searxng
ports:
- "8080:8080"
volumes:
- searxng-config:/etc/searxng
environment:
- SEARXNG_BASE_URL=http://localhost:8080
restart: unless-stopped
volumes:
searxng-config:
With Redis (Better Performance)
version: '3.8'
services:
searxng:
image: searxng/searxng:latest
container_name: searxng
ports:
- "8080:8080"
volumes:
- searxng-config:/etc/searxng
environment:
- SEARXNG_BASE_URL=http://localhost:8080
- SEARXNG_REDIS_URL=redis://redis:6379/0
depends_on:
- redis
restart: unless-stopped
redis:
image: redis:alpine
container_name: searxng-redis
command: redis-server --save 30 1 --loglevel warning
volumes:
- redis-data:/data
restart: unless-stopped
volumes:
searxng-config:
redis-data:
Start the service:
docker compose up -d
Access at: http://your-server:8080
Configuration
Settings File
Create /etc/searxng/settings.yml:
general:
instance_name: "My SearXNG"
privacypolicy_url: false
donation_url: false
contact_url: false
enable_metrics: false
search:
safe_search: 0 # 0=off, 1=moderate, 2=strict
autocomplete: "google"
default_lang: "en"
formats:
- html
- json
server:
secret_key: "your-secret-key-here" # Generate with: openssl rand -hex 32
limiter: true
image_proxy: true
method: "GET"
ui:
static_use_hash: true
default_theme: "simple"
default_locale: "en"
theme_args:
simple_style: "auto" # auto, light, dark
engines:
- name: google
disabled: false
- name: bing
disabled: false
- name: duckduckgo
disabled: false
- name: wikipedia
disabled: false
Enable/Disable Engines
Edit settings.yml:
engines:
- name: google
disabled: false
weight: 1.0
- name: bing
disabled: true # Disable Bing
- name: brave
disabled: false
weight: 1.5 # Prefer Brave results
Rate Limiting
Protect against abuse:
server:
limiter: true
limiter:
# Number of requests per time period
default:
- 3 per second
- 60 per minute
- 600 per hour
Customization
Themes
Available themes:
- simple: Clean, modern (default)
- oscar: Classic, feature-rich
- pix-art: Minimalist
Change in settings:
ui:
default_theme: "simple"
Search Shortcuts
Use bangs for direct searches:
!g query- Google!ddg query- DuckDuckGo!w query- Wikipedia!gh query- GitHub!so query- Stack Overflow!yt query- YouTube
Custom Engines
Add custom search engines:
engines:
- name: my_site
engine: xpath
search_url: https://example.com/search?q={query}
url_xpath: //a[@class="result"]/@href
title_xpath: //a[@class="result"]/text()
content_xpath: //p[@class="description"]/text()
categories: general
disabled: false
Remote Access
Via Tailscale (Recommended)
- Install Tailscale on server and devices
- Access via Tailscale IP:
http://100.x.x.x:8080 - No port forwarding required
- Encrypted connection
Via Reverse Proxy
Use NGINX for HTTPS:
server {
listen 443 ssl http2;
server_name search.yourdomain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# Increase timeout for slow searches
proxy_read_timeout 30s;
}
}
Browser Integration
Set as Default Search Engine
Firefox:
- Visit your SearXNG instance
- Right-click address bar
- "Add SearXNG"
- Settings → Search → Set as default
Chrome/Brave:
- Settings → Search engine
- Manage search engines
- Add new search engine:
- Name: SearXNG
- Keyword: s
- URL:
http://your-server:8080/search?q=%s
- Set as default
OpenSearch Plugin
SearXNG provides OpenSearch autodiscovery. Modern browsers detect it automatically.
Performance Optimization
Enable Redis
Redis caches results and improves response times:
environment:
- SEARXNG_REDIS_URL=redis://redis:6379/0
Limit Engines
Fewer engines = faster results:
engines:
# Enable only fast, reliable engines
- name: google
disabled: false
- name: duckduckgo
disabled: false
- name: brave
disabled: false
# Disable slow engines
- name: bing
disabled: true
Adjust Timeouts
outgoing:
request_timeout: 3.0 # seconds
max_request_timeout: 10.0
Privacy Enhancements
Disable Logging
server:
# Don't log searches
log_level: "ERROR"
Image Proxy
Prevent tracking via images:
server:
image_proxy: true
Disable Metrics
general:
enable_metrics: false
Use Tor (Optional)
Route searches through Tor:
outgoing:
using_tor_proxy: true
tor_proxy_url: "socks5://127.0.0.1:9050"
Troubleshooting
Slow Search Results
Causes:
- Too many engines enabled
- Slow network connection
- Engine rate limiting
Solutions:
- Disable slow engines
- Enable Redis caching
- Increase timeouts
- Use fewer engines per search
Engine Blocked
Symptoms: "Engine X returned no results"
Causes:
- Rate limiting by search engine
- IP blocked
- Engine changed API
Solutions:
- Wait and try again
- Use different engines
- Check SearXNG updates
- Use Tor or VPN
High CPU Usage
Causes:
- Many concurrent searches
- Complex result parsing
- No caching
Solutions:
- Enable Redis
- Limit concurrent requests
- Disable resource-intensive engines
Maintenance
Updates
# Pull new image
docker compose pull
# Restart with new version
docker compose up -d
Clear Cache
# Clear Redis cache
docker exec searxng-redis redis-cli FLUSHALL
Monitor Logs
# View logs
docker logs searxng
# Follow logs
docker logs -f searxng
Best Practices
Security:
- Use HTTPS via reverse proxy
- Enable rate limiting
- Set strong secret key
- Restrict access if needed
Performance:
- Enable Redis caching
- Limit number of engines
- Set reasonable timeouts
- Monitor resource usage
Privacy:
- Disable metrics and logging
- Enable image proxy
- Don't expose publicly (unless intended)
- Use Tor for extra anonymity
Maintenance:
- Regular updates
- Monitor for blocked engines
- Review and update engine list
- Check logs for errors
Alternatives
Public Instances: Use someone else's SearXNG (less private)
DuckDuckGo: Privacy-focused but centralized
Brave Search: Independent index, privacy-focused
Startpage: Google results with privacy
Whoogle: Simpler Google proxy
Public vs Self-Hosted
Public Instance:
- ✅ No setup required
- ✅ No maintenance
- ❌ Trust the operator
- ❌ Shared IP (may be rate-limited)
Self-Hosted:
- ✅ Complete control
- ✅ Maximum privacy
- ✅ Customizable
- ❌ Requires setup and maintenance
Related Topics:
- Self-Hosting a Home Server - Complete homelab guide
- Docker - Container platform
- NGINX - Reverse proxy
- Tailscale - Secure remote access