---
title: "Deploy SearXNG"
description: "Private SearXNG behind a password, with engines that answer from Railway"
category: "Other"
url: https://railway.com/deploy/searxng-4
---

# Deploy SearXNG

Private SearXNG behind a password, with engines that answer from Railway

**[Deploy SearXNG on Railway](https://railway.com/template/searxng-4)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/searxng-4/manifest.json

- **Creator:** Dektion
- **Category:** Other
- **Total deploys:** 1

## Template content

### SearXNG https://raw.githubusercontent.com/searxng/searxng/12f8b6515ca77c3c3bc1498584950ef5daca1433/searx/static/themes/simple/img/favicon.png

- **Source:** dektionstudio/railway-template-images
- **Health check:** /healthz
- **Public domain:** Yes

### Engine https://raw.githubusercontent.com/searxng/searxng/12f8b6515ca77c3c3bc1498584950ef5daca1433/searx/static/themes/simple/img/favicon.png

- **Source:** dektionstudio/railway-template-images
- **Health check:** /healthz

## Documentation

# Deploy and Host SearXNG on Railway

[SearXNG](https://github.com/searxng/searxng) is a metasearch engine: it sends your query to Google, Bing, Yahoo and others and shows the results without ads, tracking or a profile of you. It also has a JSON API, which many AI tools use for web search.

This template runs SearXNG on Railway's private network with a password prompt in front of it.

## About Hosting SearXNG

An open SearXNG on a public URL gets found and used as a free search proxy by bots, which costs you bandwidth and gets your instance blocked by the search engines. Here a small Caddy service asks for `SEARXNG_USERNAME` and `SEARXNG_PASSWORD` (generated) before anything reaches SearXNG. Only `/healthz` is open, for Railway's healthcheck.

Search engines treat Railway's datacenter IPs differently, and SearXNG's defaults don't hold up there. I tested each engine from a deployment: DuckDuckGo answered with a CAPTCHA, and Brave, Startpage, Qwant and Mojeek returned nothing. Google and Bing work, but they're not in SearXNG's default selection, so my first build only searched Yahoo and returned 7 results a query. With Google, Bing and Yahoo turned on it returned 16 to 25 results for the same queries. The settings keep those three, their news engines, Wikipedia and a few developer sources (GitHub, Stack Overflow, PyPI, npm, MDN, arXiv).

The JSON API is on (`format=json`), so you can point Open WebUI, Perplexica/Vane, n8n or your own scripts at it with the same username and password.

Before publishing I tested it on Railway. `/healthz` answered without a password, the search page without a password or with a wrong one got 401, and with the password the page loaded and JSON searches returned results from Google, Bing and Yahoo with no failing engines. After restarting both services the same checks passed.

## Common Use Cases

- A private search engine for your own browser, with no tracking and no ads
- Web search for AI tools and agents through the JSON API, without a paid search API
- One search endpoint shared by several services in a Railway project

## Dependencies for SearXNG Hosting

Nothing beyond the template. Tools need to send the username and password: most accept them in the URL (`https://user:password@your-domain/search?q=...&format=json`) or as a Basic auth header.

### Deployment Dependencies

- SearXNG: https://github.com/searxng/searxng
- Image: `searxng/searxng:2026.9.25-12f8b6515`, with Caddy 2.11.4 as the password gate
- The settings and gate this template builds: https://github.com/dektionstudio/railway-template-images/tree/main/searxng and https://github.com/dektionstudio/railway-template-images/tree/main/searxng-web

### Implementation Details

```
SEARXNG_URL                            # open this in your browser
SEARXNG_USERNAME / SEARXNG_PASSWORD    # the password prompt (password generated)
curl -u "$SEARXNG_USERNAME:$SEARXNG_PASSWORD" "$SEARXNG_URL/search?q=railway&format=json"
```

Idle, SearXNG used 0.10 GB of RAM and the gate 0.04 GB, about $1.50 a month on Railway's usage pricing.

## Why Deploy SearXNG on Railway?

You get your own search engine on HTTPS in one deploy, with engines that answer from Railway's network and a password so it stays yours. The tradeoff is that results depend on search engines that accept datacenter traffic, which can change; when one stops answering, SearXNG suspends it and uses the others.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/searxng-4
