SearXNG (w/ Official Image)
Bring powerful AI search to your apps with a self-hosted metasearch engine
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)
- Click the Deploy Button above
- Connect Your GitHub: Railway will fork this template to your account
- Deploy: Railway automatically builds and deploys your SearXNG instance
- Access: Use the provided Railway domain to access your search engine
Option 2: Add this template to your current project
- Create Select Template
- Search SearXNG (w/Official Image) and click on it.
- Deploy: Railway will automatically detect and deploy it to your project.
Example Screenshots
SearXNG search
SearXNG image search
Hook up SearXNG to n8n and start automating your searches
⚙️ Configuration
Environment Variables
You can customize your SearXNG instance using these environment variables in Railway:
Variable | Description | Default |
---|---|---|
SEARXNG_SECRET_KEY | Secret key for secure sessions | Auto-generated |
SEARXNG_BASE_URL | Base URL of your instance | Railway domain |
SEARXNG_UWSGI_WORKERS | Number of worker processes | 4 |
SEARXNG_UWSGI_THREADS | Threads per worker | 4 |
PORT | Port to listen on | 8080 (auto-set by Railway) |
Setting Environment Variables in Railway
- Go to your Railway project dashboard
- Click on your service
- Navigate to Variables tab
- Add your custom environment variables
- 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 configurationuwsgi.ini
: Auto-generated WSGI server configuration
You can modify these files and redeploy to customize your search engine behavior.
🤖 AI Integration Guide
FlowiseAI Integration
- Deploy your SearXNG instance using the one-click button above
- Get your Railway URL (e.g.,
https://your-app.railway.app
) - 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
- Add HTTP Request Node in your n8n workflow
- Configure the request:
- URL:
https://your-app.railway.app/search
- Method:
GET
- Parameters:
q
: Your search queryformat
:json
categories
:general
(optional)
- URL:
- 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
-
Set a Custom Secret Key:
SEARXNG_SECRET_KEY=your-super-secret-key-here
-
Configure Rate Limiting: Edit
searxng/limiter.toml
to adjust rate limits -
Disable Debug Mode: Edit
searxng/settings.yml
and setdebug: 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
- Official SearXNG Docker Image
- SearXNG Documentation
- Railway Platform for hosting and deployment
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