From agent-almanac
Deploys self-hosted SearXNG meta search engine via Docker Compose with Nginx proxy, settings.yml config, engine selection, and persistence. For private tracking-free search aggregating providers.
npx claudepluginhub pjt222/agent-almanacThis skill uses the workspace's default tool permissions.
---
Searches the web using self-hosted SearXNG metasearch, aggregating privacy-focused results from 70+ engines like Google and DuckDuckGo. Includes Docker setup, API usage, and shell function.
Configures Nginx as web server and reverse proxy with static file serving, SSL/TLS via Let's Encrypt, load balancing, rate limiting, and security headers for production deployments.
Guides ferris-search MCP server setup including cargo build, claude mcp add registration, Docker runs, and configuration of search engine env vars like DEFAULT_SEARCH_ENGINE, API keys, and proxies.
Share bugs, ideas, or general feedback.
Deploy a self-hosted SearXNG meta search engine with Docker Compose and Nginx.
mkdir -p searxng/{config,nginx}
cd searxng
docker-compose.yml:
services:
searxng:
image: searxng/searxng:latest
container_name: searxng
volumes:
- ./config:/etc/searxng:rw
environment:
- SEARXNG_BASE_URL=https://search.example.com/
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
restart: unless-stopped
networks:
- searxng
nginx:
image: nginx:1.27-alpine
container_name: searxng-nginx
ports:
- "8080:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- searxng
restart: unless-stopped
networks:
- searxng
networks:
searxng:
driver: bridge
config/settings.yml:
use_default_settings: true
general:
instance_name: "My SearXNG"
privacypolicy_url: false
contact_url: false
search:
safe_search: 0
autocomplete: "google"
default_lang: "en"
server:
secret_key: "generate-a-random-secret-key-here"
limiter: true
image_proxy: true
port: 8080
bind_address: "0.0.0.0"
ui:
static_use_hash: true
default_theme: simple
infinite_scroll: true
engines:
- name: google
engine: google
shortcut: g
disabled: false
- name: duckduckgo
engine: duckduckgo
shortcut: ddg
disabled: false
- name: wikipedia
engine: wikipedia
shortcut: wp
disabled: false
- name: github
engine: github
shortcut: gh
disabled: false
- name: stackoverflow
engine: stackoverflow
shortcut: so
disabled: false
- name: arxiv
engine: arxiv
shortcut: arx
disabled: false
Generate a secret key:
openssl rand -hex 32
nginx/nginx.conf:
events {
worker_connections 1024;
}
http {
server {
listen 80;
location / {
proxy_pass http://searxng: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;
proxy_set_header Connection "";
proxy_buffering off;
}
location /static/ {
proxy_pass http://searxng:8080/static/;
expires 1y;
add_header Cache-Control "public, immutable";
}
}
}
config/limiter.toml:
[botdetection.ip_limit]
link_token = true
[botdetection.ip_lists]
block_ip = []
pass_ip = ["127.0.0.1/8", "::1/128"]
pass_searxng_org = false
# Start the stack
docker compose up -d
# Check logs
docker compose logs -f searxng
# Verify it's running
curl -s http://localhost:8080 | head -5
# Test a search
curl -s "http://localhost:8080/search?q=test&format=json" | head -20
Expected: SearXNG responds on port 8080 through Nginx. Search queries return aggregated results.
On failure: Check docker compose logs searxng for config errors. Verify settings.yml YAML syntax.
For public deployments, add SSL termination. Update docker-compose.yml:
services:
nginx:
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx-ssl.conf:/etc/nginx/nginx.conf:ro
- certbot-certs:/etc/letsencrypt:ro
- certbot-webroot:/var/www/certbot:ro
certbot:
image: certbot/certbot
volumes:
- certbot-certs:/etc/letsencrypt
- certbot-webroot:/var/www/certbot
volumes:
certbot-certs:
certbot-webroot:
See configure-nginx skill for the full SSL Nginx configuration.
# Pull latest image
docker compose pull searxng
# Restart with new image
docker compose up -d
# Backup configuration
cp -r config/ config-backup-$(date +%Y%m%d)/
secret_key in settings.yml.:rw not :ro.settings.yml is sensitive to indentation. Validate with a YAML linter before deploying.SEARXNG_BASE_URL must match the actual URL users access, including protocol and trailing slash.setup-compose-stack - general Docker Compose patterns used hereconfigure-nginx - Nginx configuration for SSL and security headersconfigure-reverse-proxy - advanced proxy patterns for the Nginx frontend