deploy-searxng
について
このClaude Skillは、Docker Composeを使用してセルフホスト型のSearXNGメタ検索エンジンをデプロイし、トラッキングのないプライベートな検索ソリューションを提供します。設定、検索エンジンの選択、Nginxのセットアップ、複数のプロバイダーからの結果を集約するための永続化を処理します。チームで共有する検索インスタンスが必要な場合や、単一の商用プロバイダーへの依存を置き換えたい場合にご利用ください。
クイックインストール
Claude Code
推奨npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/deploy-searxngこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします
ドキュメント
Deploy SearXNG
Deploy self-hosted SearXNG meta search engine with Docker Compose and Nginx.
When Use
- Set up private, self-hosted search engine
- Aggregate results from multiple search providers without tracking
- Run search instance for team or organization
- Replace reliance on single search provider
Inputs
- Required: Server or machine with Docker installed
- Optional: Domain name for public access
- Optional: SSL certificate or Let's Encrypt setup
- Optional: Custom engine preferences
Steps
Step 1: Create Project Structure
mkdir -p searxng/{config,nginx}
cd searxng
Step 2: Write Docker Compose File
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
Step 3: Configure SearXNG Settings
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 secret key:
openssl rand -hex 32
Step 4: Configure Nginx Frontend
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";
}
}
}
Step 5: Configure Rate Limiting
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
Step 6: Deploy and Verify
# Start stack
docker compose up -d
# Check logs
docker compose logs -f searxng
# Verify running
curl -s http://localhost:8080 | head -5
# Test search
curl -s "http://localhost:8080/search?q=test&format=json" | head -20
Got: SearXNG responds on port 8080 through Nginx. Search queries return aggregated results.
If fail: Check docker compose logs searxng for config errors. Verify settings.yml YAML syntax.
Step 7: Add SSL (Production)
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 full SSL Nginx configuration.
Step 8: Updates and Maintenance
# 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)/
Checks
- SearXNG starts without errors in logs
- Search queries return results from configured engines
- Image proxy works (images load through SearXNG)
- Rate limiter blocks excessive requests
- Configuration persists across container restarts
- Nginx proxies requests correctly
Pitfalls
- Missing secret_key: SearXNG refuses to start without
secret_keyin settings.yml. - Config permissions: SearXNG writes to config directory. Volume must be
:rwnot:ro. - Engine blocks: Some engines block requests from server IPs. Rotate engines or use image proxy.
- YAML indentation:
settings.ymlsensitive to indentation. Validate with YAML linter before deploying. - Base URL mismatch:
SEARXNG_BASE_URLmust match actual URL users access, including protocol and trailing slash. - DNS resolution in Docker: Engines using Google/Bing may need host network or proper DNS. Default Docker DNS usually works.
See Also
setup-compose-stack- general Docker Compose patterns used hereconfigure-nginx- Nginx configuration for SSL and security headersconfigure-reverse-proxy- advanced proxy patterns for Nginx frontend
GitHub リポジトリ
関連スキル
railway-docs
ドキュメントこのスキルは、Railwayの機能や仕様、特定のドキュメントURLに関する質問に答えるために、最新のRailwayドキュメントを取得します。開発者がRailwayの公式情報源から正確かつ最新の情報を直接受け取れるようにします。ユーザーがRailwayの動作方法について尋ねたり、Railwayドキュメントを参照する際にご利用ください。
n8n-code-python
ドキュメントこのClaudeスキルは、n8nのコードノードでPythonコードを記述するための専門的なガイダンスを提供します。具体的には、Pythonの標準ライブラリの使用方法や、`_input`、`_json`、`_node`といったn8n独自の構文の扱い方を解説します。n8n環境内におけるPythonの制限事項を開発者が理解できるよう支援し、ほとんどのワークフローではJavaScriptの使用を推奨しながらも、特定のデータ変換ニーズに対応するPythonソリューションを提案します。
archon
ドキュメントArchonスキルは、RAGを活用したセマンティック検索とプロジェクト管理をREST APIを通じて提供します。ドキュメントの検索、階層的なプロジェクト/タスクの管理、ドキュメントアップロード機能を備えたナレッジ検索の実行にご利用いただけます。外部ドキュメントを検索する際は、他の情報源を利用する前に常にArchonを最優先で使用してください。
n8n-code-javascript
ドキュメントこのClaudeスキルは、n8nのCodeノードでJavaScriptコードを書くための専門的なガイダンスを提供します。`$input`/`$json`変数、HTTPヘルパー、DateTime処理などの重要なn8n固有の構文を網羅し、一般的なエラーのトラブルシューティングも行います。CodeノードでカスタムJavaScript処理を必要とするn8nワークフローを開発する際にご利用ください。
