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.
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
- 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.
- Deploy SearXNG instantly to Railway with zero configuration
- Automatic HTTPS and domain provisioning
- No Docker knowledge required
- 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
- Railway Integration: Automatically detects Railway's
PORTenvironment 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
- 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
- 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
- Create Select Template
- Search SearXNG (w/Official Image) and click on it.
- Deploy: Railway will automatically detect and deploy it to your project.
# Clone the repository
git clone <your-fork-url>
cd searxng-docker
# Start with docker-compose
docker-compose up -d
# Access at http://localhost:8080Hook up SearXNG to n8n and start automating your searches
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) |
- Go to your Railway project dashboard
- Click on your service
- Navigate to Variables tab
- Add your custom environment variables
- Redeploy if necessary
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.
- 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
- 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:jsoncategories:general(optional)
- URL:
- Process the results using n8n's data transformation nodes
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"{
"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"
}
]
}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-
Set a Custom Secret Key:
SEARXNG_SECRET_KEY=your-super-secret-key-here
-
Configure Rate Limiting: Edit
searxng/limiter.tomlto adjust rate limits -
Disable Debug Mode: Edit
searxng/settings.ymland setdebug: false
searxng-docker/
├── Dockerfile # Container configuration
├── docker-compose.yml # Local development setup
├── entrypoint.sh # Container startup script
├── README.md # This file
└── searxng/ # SearXNG configuration
├── settings.yml # Main SearXNG settings
├── limiter.toml # Rate limiting configuration
└── uwsgi.ini # Auto-generated WSGI config
- Fork this repository
- Make your changes
- Test locally with
docker-compose up - Submit a pull request
This template is open source. SearXNG itself is licensed under the GNU Affero General Public License v3.0.
Happy Searching! 🔍✨