SearXNG (w/ Official Image)

Bring powerful AI search to your apps with a self-hosted metasearch engine

Deploy SearXNG (w/ Official Image)

searxng-railway

protemplate/searxng

Just deployed

/etc/searxng

SearXNG Docker Template for Railway

A ready-to-deploy SearXNG metasearch engine template for Railway. Get your own privacy-focused search engine running in minutes! Perfect for AI agents, FlowiseAI, n8n workflows, and any application needing web search capabilities.

🔍 About SearXNG

SearXNG is a free internet metasearch engine that aggregates results from more than 70 search services. It's designed to provide:

  • Privacy Protection: No tracking, no data collection, no user profiling
  • Ad-Free Experience: Clean search results without advertisements
  • Multiple Sources: Combines results from Google, Bing, DuckDuckGo, and many more
  • AI-Ready: JSON API perfect for AI agents, chatbots, and automation workflows
  • Open Source: Fully transparent and community-driven
  • Customizable: Configure which search engines to use and how results are displayed

✨ Features & Benefits of This Railway Template

🤖 AI-Optimized & Ready

  • AI Integration Ready: Perfect backend for AI agents, chatbots, and automation tools
  • FlowiseAI Compatible: Easy integration with FlowiseAI workflows for intelligent search
  • n8n Ready: Seamless connection with n8n automation workflows
  • API Access: JSON responses available for programmatic access
  • No API Keys Required: Free alternative to Google Search API, Bing API, etc.

🚀 One-Click Deployment

  • Deploy SearXNG instantly to Railway with zero configuration
  • Automatic HTTPS and domain provisioning
  • No Docker knowledge required

⚙️ Environment-Driven Configuration

  • Customizable Settings: Override default configurations using environment variables
  • Scalable Performance: Adjust worker count and threads based on your needs
  • Security: Set custom secret keys for enhanced security

🔧 Optimized for Railway

  • Railway Integration: Automatically detects Railway's PORT environment variable
  • Dynamic Base URL: Configures itself based on Railway's provided domain
  • Volume Mount Compatible: Works seamlessly with Railway's volume mounts
  • Persistent Configuration: Custom settings persist across deployments

🛡️ Security & Privacy

  • Rate Limiting: Built-in protection against abuse (configurable)
  • No Data Retention: Search queries are not logged or stored
  • Secret Key Management: Secure session handling with customizable keys

🚀 How to Use This Template

Option 1: One-Click Deployment (Recommended)

  1. Click the Deploy Button above
  2. Connect Your GitHub: Railway will fork this template to your account
  3. Deploy: Railway automatically builds and deploys your SearXNG instance
  4. Access: Use the provided Railway domain to access your search engine

Option 2: Add this template to your current project

  1. Create Select Template
  2. Search SearXNG (w/Official Image) and click on it.
  3. Deploy: Railway will automatically detect and deploy it to your project.

Example Screenshots

SearXNG search SearXNG search!

SearXNG image search SearXNG image search!

Hook up SearXNG to n8n and start automating your searches SearXNG image search!

⚙️ Configuration

Environment Variables

You can customize your SearXNG instance using these environment variables in Railway:

VariableDescriptionDefault
SEARXNG_SECRET_KEYSecret key for secure sessionsAuto-generated
SEARXNG_BASE_URLBase URL of your instanceRailway domain
SEARXNG_UWSGI_WORKERSNumber of worker processes4
SEARXNG_UWSGI_THREADSThreads per worker4
PORTPort to listen on8080 (auto-set by Railway)

Setting Environment Variables in Railway

  1. Go to your Railway project dashboard
  2. Click on your service
  3. Navigate to Variables tab
  4. Add your custom environment variables
  5. Redeploy if necessary

Custom Configuration Files

The template includes these configuration files in the searxng/ directory:

  • settings.yml: Main SearXNG configuration (search engines, UI settings)
  • limiter.toml: Rate limiting configuration
  • uwsgi.ini: Auto-generated WSGI server configuration

You can modify these files and redeploy to customize your search engine behavior.

🤖 AI Integration Guide

FlowiseAI Integration

  1. Deploy your SearXNG instance using the one-click button above
  2. Get your Railway URL (e.g., https://your-app.railway.app)
  3. In FlowiseAI:
    • Use the HTTP Request node
    • Set URL to: https://your-app.railway.app/search?q={query}&format=json
    • Method: GET
    • Use the JSON response in your AI workflows

n8n Integration

  1. Add HTTP Request Node in your n8n workflow
  2. Configure the request:
    • URL: https://your-app.railway.app/search
    • Method: GET
    • Parameters:
      • q: Your search query
      • format: json
      • categories: general (optional)
  3. Process the results using n8n's data transformation nodes

API Usage Examples

Basic Search:

curl "https://your-app.railway.app/search?q=artificial+intelligence&format=json"

Search with Category:

curl "https://your-app.railway.app/search?q=machine+learning&format=json&categories=general,it"

Image Search:

curl "https://your-app.railway.app/search?q=robots&format=json&categories=images"

Response Format

{
  "query": "artificial intelligence",
  "number_of_results": 25,
  "results": [
    {
      "title": "Artificial Intelligence - Wikipedia",
      "url": "https://en.wikipedia.org/wiki/Artificial_intelligence",
      "content": "Artificial intelligence (AI) is intelligence demonstrated by machines...",
      "engine": "google"
    }
  ]
}

🔧 Advanced Usage

Scaling Your Instance

For high-traffic usage, adjust these environment variables:

SEARXNG_UWSGI_WORKERS=8    # Increase workers for more concurrent requests
SEARXNG_UWSGI_THREADS=6    # Increase threads per worker

Security Hardening

  1. Set a Custom Secret Key:

    SEARXNG_SECRET_KEY=your-super-secret-key-here
    
  2. Configure Rate Limiting: Edit searxng/limiter.toml to adjust rate limits

  3. Disable Debug Mode: Edit searxng/settings.yml and set debug: false

Happy Searching! 🔍✨

Deploy and Host SearXNG (w/ Official Image) on Railway

SearXNG is a privacy-focused metasearch engine that aggregates results from multiple search engines without tracking users. Built for developers, AI agents, and automation workflows, it provides clean, ad-free search results while protecting user privacy and offering extensive customization options.

About Hosting SearXNG (w/ Official Image)

Hosting SearXNG involves deploying a containerized metasearch engine that acts as a proxy between users and major search engines. The official Docker image includes all necessary dependencies and configurations for immediate deployment. Railway simplifies this process by handling container orchestration, SSL certificates, and scaling automatically. The deployment includes customizable search engine configurations, result filtering, and API endpoints for programmatic access, making it perfect for integration with AI workflows and automation tools.

Common Use Cases

  • AI Agent Integration: Provide real-time web search capabilities to AI assistants and chatbots
  • Privacy-Focused Search Portal: Create a private search engine for organizations or personal use without tracking
  • Automation Workflows: Integrate with n8n, FlowiseAI, or other automation platforms for programmatic web searches
  • Development & Research: Use as a clean API for gathering web data in applications and research projects

Dependencies for SearXNG (w/ Official Image) Hosting

  • Docker Runtime: Railway provides containerized deployment using the official SearXNG Docker image
  • Environment Configuration: Customizable settings for search engines, UI preferences, and API access

Deployment Dependencies

Implementation Details

The deployment uses a custom entrypoint script to handle Railway-specific environment variables and port configuration:

FROM docker.io/searxng/searxng:latest

# Railway environment variables
ARG SEARXNG_BASE_URL
ARG PORT
ENV BASE_URL=${SEARXNG_BASE_URL}
ENV PORT=${PORT:-8080}

COPY ./searxng /etc/searxng
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

The template includes pre-configured search engine settings and custom themes optimized for various use cases including API access and web interface usage.

Why Deploy SearXNG (w/ Official Image) on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying SearXNG (w/ Official Image) on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

searxng-railway

protemplate/searxng

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

View Template
openui
Deploy OpenUI: AI-powered UI generation with GitHub OAuth and OpenAI API.

View Template
firecrawl
firecrawl api server + worker without auth, works with dify