---
title: "Deploy SearXNG API"
description: "A pre-configured SearXNG optimized for private and LLM tool use."
category: "AI/ML"
url: https://railway.com/deploy/searxng-api
---

# Deploy SearXNG API

A pre-configured SearXNG optimized for private and LLM tool use.

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

- **Creator:** Joey Chilson
- **Category:** AI/ML
- **Total deploys:** 33

## Template content

### searxng

- **Image:** ghcr.io/joeychilson/railway-searxng:1.1
- **Health check:** /healthz

## Documentation

# Deploy and Host SearXNG API on Railway

A private SearXNG instance configured for backends, scripts, and LLM agents that need a plain GET JSON search API.

## About Hosting SearXNG API

This template intentionally creates **no public domain**. SearXNG has no authentication and this configuration disables its rate limiter, so other services in the same Railway project should call it over Railway's private network:

```text
http://searxng.railway.internal:8080
```

Traffic stays inside the project and does not require public networking. The image provides an exact curated engine set, bounded upstream request timeouts, and a `/healthz` deployment check.

## Why Deploy SearXNG API on Railway?

Railway provides private service discovery, health-checked deployments, and automatic tested image updates without requiring a public endpoint or an additional database service. The generated secret and internal DNS name make the instance ready for another service in the project to use immediately.

## Common Use Cases

- Private web search for AI agents and LLM applications
- Search aggregation for a backend service
- Developer and package search through GitHub, StackOverflow, npm, PyPI, and related engines
- Academic search through arXiv, Semantic Scholar, Crossref, and PubMed

## Dependencies for SearXNG API Hosting

The template is a single service. **Redis or Valkey is not required** because this private configuration runs without SearXNG's rate limiter.

### Deployment Dependencies

- `SEARXNG_SECRET` — the only required variable; generated automatically by the template
- A second service in the same Railway project if you want to consume the API over private networking
- `SEARXNG_BASE_URL` only if you deliberately enable a public domain

## Configuration

The template generates `SEARXNG_SECRET` automatically. It is used by SearXNG for server-side cryptography.

`SEARXNG_BASE_URL` is optional and is only needed when you deliberately expose the service through a public domain.

## API Usage

From another service in the same Railway project:

```bash
# General web search
curl "http://searxng.railway.internal:8080/search?q=python+async&format=json"

# Developer sources
curl "http://searxng.railway.internal:8080/search?q=tokio+channels&format=json&categories=it"

# Academic sources
curl "http://searxng.railway.internal:8080/search?q=mixture+of+experts&format=json&categories=science"

# Specific engines
curl "http://searxng.railway.internal:8080/search?q=transformers&format=json&engines=arxiv,github"
```

The JSON response includes `results`, `answers`, `infoboxes`, and `suggestions`.

## Curated Search Engines

- **General:** DuckDuckGo, Brave, Startpage, Qwant, Mojeek, Wikipedia, Wikidata, Currency
- **Developer:** GitHub, GitLab, StackOverflow, MDN, Hacker News, Arch Wiki, npm, PyPI, crates.io, pkg.go.dev, Docker Hub
- **Academic:** arXiv, Semantic Scholar, Crossref, PubMed

Engines that commonly block datacenter IPs are excluded to reduce failures and latency.

## Optional Public Access

If you need access from outside Railway, enable public networking on target port `8080` and set `SEARXNG_BASE_URL` to the generated HTTPS URL.

**Anyone with that URL can query the instance.** Add your own authentication layer or enable SearXNG's limiter before treating it as a public service.

## Updates

The template follows the maintained `1.1` image channel and applies tested patch releases during its configured maintenance window. Each release is built and smoke-tested before publication.

Source and full documentation: https://github.com/joeychilson/railway-searxng


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

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