NewCode CLOUD — 20% off your first month on all cloud VPSClaim

Self-Hosted Private Search Engine on Hong Kong VPS: SearXNG (2026)

· 3 min read

SearXNG is a self-hosted meta-search engine that queries Google, Bing, DuckDuckGo, Baidu, and 70+ other search engines simultaneously — aggregating results without exposing your queries to any single search provider’s tracking. Running on a Hong Kong VPS, SearXNG gives your team and users privacy-respecting search that reaches both international engines and Chinese-accessible engines like Baidu from the same interface, via CN2 GIA.


Step 1: Deploy SearXNG with Docker

<code">apt update && apt upgrade -y
curl -fsSL https://get.docker.com | sh
systemctl enable --now docker
apt install -y nginx certbot python3-certbot-nginx

mkdir -p /opt/searxng/{data,config}

# Generate a secret key
SECRET_KEY=$(openssl rand -hex 32)

cat > /opt/searxng/config/settings.yml << EOF
use_default_settings: true

general:
  instance_name: "Private Search"
  privacypolicy_url: false
  contact_url: false

search:
  safe_search: 0
  autocomplete: "google"
  default_lang: "auto"
  ban_time_on_fail: 5
  max_ban_time_on_fail: 120

server:
  secret_key: "${SECRET_KEY}"
  limiter: true
  image_proxy: true
  method: "GET"
  base_url: https://search.yourdomain.com/

ui:
  static_use_hash: true
  default_theme: simple
  theme_args:
    simple_style: dark

# Enable both international and Chinese search engines
engines:
  - name: google
    engine: google
    shortcut: g
    disabled: false

  - name: bing
    engine: bing
    shortcut: bi
    disabled: false

  - name: baidu
    engine: baidu
    shortcut: bd
    disabled: false
    timeout: 5.0

  - name: duckduckgo
    engine: duckduckgo
    shortcut: ddg
    disabled: false

  - name: github
    engine: github
    shortcut: gh

  - name: stackoverflow
    engine: stackoverflow
    shortcut: so

  - name: wikipedia
    engine: wikipedia
    shortcut: wp
EOF

docker run -d \
  --name searxng \
  --restart unless-stopped \
  -p 127.0.0.1:8080:8080 \
  -v /opt/searxng/config:/etc/searxng \
  -v /opt/searxng/data:/var/cache/searxng \
  -e SEARXNG_BASE_URL=https://search.yourdomain.com/ \
  searxng/searxng:latest

docker logs searxng

Step 2: Nginx with SSL

<code">cat > /etc/nginx/sites-available/searxng << 'EOF'
server {
    listen 443 ssl http2;
    server_name search.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/search.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/search.yourdomain.com/privkey.pem;

    # Optional: restrict to known IPs for private use
    # allow YOUR_OFFICE_IP;
    # allow YOUR_HOME_IP;
    # deny all;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_buffering off;
    }
}
EOF

ln -s /etc/nginx/sites-available/searxng /etc/nginx/sites-enabled/
certbot --nginx -d search.yourdomain.com
nginx -t && systemctl reload nginx

Step 3: Configure Engine Preferences

In the SearXNG web interface → Preferences → Engines, configure which search engines to enable by default. Key choices for Asia-Pacific users:

  • Baidu — essential for Chinese-language queries and news
  • Google — best global results (queries proxied through your HK VPS)
  • Bing — good for image search and news
  • GitHub — code search
  • ArXiv — academic papers
  • Wikidata — factual queries

Step 4: Set as Default Browser Search Engine

<code"># Add as OpenSearch-compatible engine in browser:
# In Chrome: Settings → Search engines → Manage → Add
# Name: Private Search (HK)
# Keyword: s
# URL: https://search.yourdomain.com/?q=%s

# In Firefox: visit https://search.yourdomain.com
# Click the search bar → "Add Private Search (HK)"

Step 5: Enable Caching for Performance

<code"># Add Redis caching to reduce repeat query latency
docker run -d \
  --name redis-search \
  --restart unless-stopped \
  redis:alpine

# Update SearXNG settings.yml:
# Add under server:
#   redis:
#     url: redis://redis-search:6379/0

# Restart with Redis linked
docker stop searxng && docker rm searxng

docker run -d \
  --name searxng \
  --restart unless-stopped \
  --link redis-search:redis \
  -p 127.0.0.1:8080:8080 \
  -v /opt/searxng/config:/etc/searxng \
  -v /opt/searxng/data:/var/cache/searxng \
  -e SEARXNG_BASE_URL=https://search.yourdomain.com/ \
  searxng/searxng:latest

Why HK VPS Is Ideal for SearXNG

  • Baidu access — Baidu is accessible from Hong Kong without restrictions, giving users combined international + Chinese search results in one interface
  • Google via HK IP — Google results served via your HK VPS IP, not filtered by Google based on your personal search history
  • No tracking — search queries never leave your VPS to any tracking third party
  • Team search — one shared SearXNG instance with custom engine preferences for your team’s needs

Updating SearXNG

<code">docker pull searxng/searxng:latest
docker stop searxng && docker rm searxng
# Re-run the docker run command from Step 1

Conclusion

SearXNG on a Hong Kong VPS gives individuals and teams a private search interface that combines results from international search engines (Google, Bing, DuckDuckGo) and Chinese engines (Baidu) without tracking — all proxied through your Hong Kong VPS with CN2 GIA routing. The self-hosted approach means no queries are logged by commercial search providers, and the HK VPS location provides optimal access to both international and Chinese search APIs simultaneously.

Deploy private search: Browse Server.HK Hong Kong VPS plans — SearXNG runs on any plan; a 1 GB plan is sufficient for personal or small team use.

Related articles

More in VPS & ServersServer setup guides