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

Supported Engines

Privacy Features

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:

Change in settings:

ui:
  default_theme: "simple"

Search Shortcuts

Use bangs for direct searches:

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

  1. Install Tailscale on server and devices
  2. Access via Tailscale IP: http://100.x.x.x:8080
  3. No port forwarding required
  4. 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:

  1. Visit your SearXNG instance
  2. Right-click address bar
  3. "Add SearXNG"
  4. Settings → Search → Set as default

Chrome/Brave:

  1. Settings → Search engine
  2. Manage search engines
  3. Add new search engine:
    • Name: SearXNG
    • Keyword: s
    • URL: http://your-server:8080/search?q=%s
  4. 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:

Solutions:

Engine Blocked

Symptoms: "Engine X returned no results"

Causes:

Solutions:

High CPU Usage

Causes:

Solutions:

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:

Performance:

Privacy:

Maintenance:

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:

Self-Hosted:


Related Topics: