---
title: "Deploy RustXNG"
description: "SearXNG-compatible web search and grounding API for AI agents"
category: "AI/ML"
url: https://railway.com/deploy/deploy-rustxng-search-for-ai-agents
---

# Deploy RustXNG

SearXNG-compatible web search and grounding API for AI agents

**[Deploy RustXNG on Railway](https://railway.com/template/deploy-rustxng-search-for-ai-agents)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-rustxng-search-for-ai-agents/manifest.json

- **Creator:** onepush
- **Category:** AI/ML

## Template content

### RustXNG https://github.com/sahenjp.png

- **Image:** ghcr.io/onepush-dev/rustxng:0.26.0
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted RustXNG (Search for AI Agents) on Railway

This template deploys RustXNG, a self-hosted, SSRF-hardened search and grounding engine that is SearXNG compatible.

## About Hosting RustXNG open-source software on Railway (self hosted RustXNG template)

This template runs one stateless RustXNG service built on the upstream 0.26.0 image. The response cache lives in memory, so there is no volume to back up.

Railway handles the container build, the HTTPS domain, the /healthz check, restarts, and a private network address for agents in the same project.

## Why Deploy RustXNG, the open-source search API for AI agents on Railway (Railway Free Trial)

Tavily is a hosted, keyed API that bills per request, so every agent loop adds to the bill. Railway's free trial credit is enough to try it.

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 RustXNG 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.

### Railway vs Other Hosting Providers and VPS for RustXNG self hosting

Choosing a host for this single service comes down to managed convenience versus control of the machine.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | A one-click template with domain, health check and private network wired up. | Root access and fixed droplet sizes, but you install Docker, TLS and updates. |
| AWS | Service, domain and private network configured, with usage-based billing. | Fine-grained networking and IAM, with a much larger setup surface for one container. |
| Hetzner | No server administration and deploys straight from the template. | Low-cost European machines where you own the OS, firewall and every update. |

Pick Railway for minimal upkeep, or a VPS when you want the machine under your own control.

## Common Use Cases for hosted RustXNG

- **Keyless web search for AI agents:** Point an agent's search tool at the public domain and it gets ranked results with no API key to rotate and no per-query fee to track.
- **Grounding answers with page text:** Each request returns the text of the top pages alongside the results, so the agent can answer from sources it has actually read instead of guessing from snippets.
- **SearXNG-compatible backend for Open WebUI or LibreChat:** Set the search URL to your RustXNG domain with the JSON format enabled, and the chat frontend uses it like any SearXNG instance.
- **Private search for agents in the same Railway project:** Agents running in the same project can call the private network address on port 8080, so search traffic never crosses the public internet.
- **A metasearch UI for yourself:** Open the public domain in a browser to run queries across many engines from one page, useful when you want a personal search front end you control.

## Dependencies for RustXNG Docker hosted on Railway

This template runs one service and nothing else. RustXNG keeps its cache in memory, so there is no database, no Redis and no volume to attach.

### Deployment Dependencies for Managed RustXNG Service (a single stateless RustXNG service with no volume)

The template creates a single RustXNG service with a public domain on port 8080 and a health check at /healthz. Restart policy is set to always.

### Implementation Details for RustXNG (Using the onepush-dev image built on the upstream 0.26.0 image)

The service runs the onepush-dev image, ghcr.io/onepush-dev/rustxng:0.26.0, which is built on the upstream ghcr.io/sahenjp/rustxng:0.26.0 image with the binary unchanged.

| Variable | Default | Purpose |
|---|---|---|
| SEARXNG_SECRET | Generated secret (48 characters) | Secret key used by the instance |
| SEARXNG_BASE_URL | https://${{RAILWAY_PUBLIC_DOMAIN}}/ | Public base URL the instance advertises |

## How does RustXNG compare against other tools

### RustXNG vs SearXNG (SearXNG Alternative)

- **Footprint:** RustXNG is a single small Rust binary with fast cold starts and low memory use, while SearXNG is a Python metasearch engine.
- **Compatibility:** RustXNG aims to match the SearXNG JSON search endpoint, so existing clients can often point at it unchanged.
- **Page text:** RustXNG can return text from the top result pages in the same request, which helps agents ground answers.
- **Where SearXNG wins:** SearXNG has a longer track record and a larger community.

### RustXNG vs Tavily (Tavily Alternative)

- **Cost:** RustXNG is free and keyless to self host, while Tavily is a hosted keyed API that bills per request.
- **Data path:** Your queries run on infrastructure you control rather than a third-party service.
- **Where Tavily wins:** Tavily needs no servers or upkeep and comes with managed support.

### RustXNG vs Brave Search API (Brave Search API Alternative)

- **Index versus metasearch:** Brave Search API uses its own index, while RustXNG fans out to many upstream engines and ranks the combined results.
- **Keys and limits:** RustXNG needs no API key and has no per-query fee.
- **Where Brave Search API wins:** It has one consistent index and official support, so results do not depend on third-party engines staying reachable.

### RustXNG on your laptop with Docker vs RustXNG on Railway (Local Docker vs Railway Hosting)

- **Availability:** A laptop container runs only while your machine is on, while the Railway service stays reachable on a public domain.
- **Private networking:** Agents in the same Railway project can call RustXNG over the private network.
- **Exposure:** Railway makes the instance public by default, so enable the rate limiter or keep the domain private if abuse is a concern.

## How to use RustXNG on Railway?

1. Wait for the service to turn green in the Railway dashboard. The first build can take a few minutes.
2. Open the public domain Railway generated for the service to load the search UI and run a test query.
3. Call the JSON API with your public domain:

```
https://your-domain/search?q=open+source+metasearch&format=json
```

4. Point Open WebUI, LibreChat, or LangChain's SearxSearchWrapper at the same base URL. Any SearXNG-compatible client should accept it.
5. Agents in the same Railway project can use the private domain on port 8080 instead. Traffic stays on the private network.
6. Decide on the rate limiter before sharing the URL. The instance is open by default, so keep the domain private or add a custom settings.toml with the limiter enabled.

Check that the service is up:

```
curl https://your-domain/healthz
```

## How to self host RustXNG on other VPS Services (RustXNG self hosting guide)

### Clone the Repository

Clone the upstream project to get the source, example settings and Dockerfile.

```bash
git clone https://github.com/sahenjp/RustXNG.git
cd RustXNG
```

### Install Dependencies

Docker is the simplest route on a VPS and needs no Rust toolchain.

```bash
# Option A: Docker (no build needed)
docker pull ghcr.io/sahenjp/rustxng

# Option B: from source (requires Rust 1.85 or newer)
cargo install --path .
```

You can also download a prebuilt binary from Releases and check its .sha256 file first.

### Configure Environment Variables

Copy the example settings and bind your own copy into the container. Set a strong secret and your base URL, using your-domain as the host.

```bash
cp settings.toml my-settings.toml
# edit my-settings.toml: set the secret and base_url for your-domain
```

Mount the file read only so the container cannot change it.

### Start the RustXNG Application

Run the container with port 8888 published, or start the binary directly with your settings.

```bash
docker run -p 8888:8888 \
  -v "$PWD/my-settings.toml:/app/settings.toml:ro" \
  ghcr.io/sahenjp/rustxng
```

Railway handles the reverse proxy, TLS, public domain and restarts for you, but on a VPS you must set those up yourself.

## Official Pricing of RustXNG (RustXNG pricing)

RustXNG is open-source software licensed under AGPL-3.0-or-later, and it is free to self-host. There is no paid RustXNG plan and no license fee to pay.

## RustXNG hosted vs self hosted comparison (Pricing, features, costs, and more)

There is no hosted plan for RustXNG, so you choose between running it on Railway or on a VPS you manage. The software is AGPL-3.0-or-later and free to run, with the same features either way.

### Monthly cost of self hosting RustXNG on Railway

Railway cost is usage-based and depends on the RAM and CPU the single RustXNG service uses, plus any other services in the project. RustXNG has no volume, so there is no storage line to plan for.

### System Requirements for Hosting RustXNG on a VPS

A VPS needs enough memory and CPU for one small Rust binary, plus a container runtime if you use Docker. Put it behind a reverse proxy with TLS if it is public.

## Frequently Asked Questions (FAQs)

### Do I need an API key to use RustXNG?

No. RustXNG is keyless and free to self-host, so your agents and tools can call the search endpoint without registering with any search provider.

### Why do Google and DuckDuckGo return nothing?

Those engines block requests from datacenter IP addresses, as is usual for SearXNG-style engines running on cloud hosts. Other engines such as Bing, Yahoo and Wikipedia still return results from Railway.

### Is the instance open to the public?

Yes, the instance is open by default.

### Does RustXNG need a volume?

No. The response cache lives in memory, so the single service runs without a volume and starts cleanly on each deploy.

### Is RustXNG compatible with SearXNG clients?

Yes. It exposes a SearXNG-compatible JSON API at /search, so Open WebUI, LibreChat, LangChain SearxSearchWrapper and similar clients can point at your instance URL.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius v0.1 Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/deploy-rustxng-search-for-ai-agents
