Install RustXNG with Cargo and Access It via Localtonet
Set up RustXNG, the self-hosted metasearch and AI-agent search API, verify it locally, then reach it remotely over a secure Localtonet HTTP tunnel.
In this article 12 sections
Build a private metasearch endpoint for people and AI agents, check it locally, then reach it from anywhere
RustXNG is a self-hosted metasearch engine written in Rust. It has a browser interface and a JSON search endpoint that AI agents and scripts can call. This guide covers installing it with Cargo, as a prebuilt release binary or as a container image. It then shows how to check the service on your own machine and keep it running. Finally, we publish it through a Localtonet HTTP tunnel with access controls, so you can reach it remotely without port forwarding or a public IP address.
📋 What's in this guide
Why self-host RustXNG?

A metasearch engine does not maintain its own index of the web. It takes your query, sends it to one or more upstream search engines, collects the results and returns them in a single, consistent format. Running one yourself gives you a search interface that you control. You decide where it runs and who can reach it, and you get one predictable output format no matter which upstream sources answered the query.
That last point is why projects like RustXNG matter for AI agents. A language model agent that needs fresh information from the web has to call a search tool. If that tool returns structured JSON from an endpoint you host, the agent gets machine-readable results and you avoid scraping HTML or juggling several commercial search APIs. RustXNG provides two surfaces for this: a web interface for people at the root path / and a JSON search endpoint at /search for programs.
The project ships in more than one form. Its README describes prebuilt release binaries for Linux, macOS and Windows, installation through Cargo from a tagged Git revision of the repository, and a container image published as ghcr.io/sahenjp/rustxng. When it starts, the service listens on 127.0.0.1:29483. At the time of writing, the latest tagged release was v0.31.2. The project is under active development, so check its releases page for a newer tag before you install.
The install paths, default address, endpoints and image name above come from the RustXNG README. Some project-specific details change between releases and are not reproduced here: the exact form of the repository URL for cargo install, the executable and package names, release asset names and architectures, whether releases are signed or ship checksums, configuration flags and environment variables, the /search parameter names and JSON field names, built-in authentication or rate limiting, and the minimum Rust version. For each one, this guide shows you how to read the answer directly from your own installation, so you can complete every step without guessing. Commands for Cargo, Docker, systemd and the operating system are standard tool behavior and do not depend on RustXNG.
Where Localtonet fits
Because RustXNG binds to 127.0.0.1, it accepts connections only from the machine it runs on. That is a sensible default. It also means a laptop elsewhere, a phone or an AI agent running in the cloud cannot reach it. The usual workarounds are router port forwarding, firewall changes, a public IP or a VPN. Each one adds work and can widen your exposure.
With Localtonet, the client application on the same machine opens an outbound connection to our relay server. An HTTP tunnel then gives you a public HTTPS address that forwards to 127.0.0.1:29483. Nothing on your router changes. The public address works only while the client is connected and the tunnel is running, and you can put Basic Authentication, IP Restriction or other per-tunnel controls in front of it so only your own agents and devices get through.
How the pieces fit together

Before installing anything, it helps to have a clear picture of the request path. A remote client, whether a browser or an AI agent, sends an HTTPS request to the public address of your Localtonet tunnel. TLS ends at our server, where the certificate is provided and renewed for you. The request then travels down the outbound connection the Localtonet client already holds open, and the client passes it to RustXNG on the loopback interface as plain HTTP. RustXNG queries its upstream engines, builds a response and sends it back along the same path.
/ and JSON results at /search, and listens on 127.0.0.1:29483 by default.
The last card is easy to overlook, and it shapes most of the security advice later in this guide. If strangers can query your instance, their traffic reaches upstream engines from your IP address. That can lead to rate limiting or blocking that affects your own use.
Prerequisites
What you need depends on the installation path. Cargo compiles RustXNG from source, so it needs the most tooling. The prebuilt binary needs almost nothing. The container image needs a working container runtime. The table below summarizes the paths, and the subsections explain each requirement.
| Installation path | What you need | Best for | Trade-offs |
|---|---|---|---|
| Cargo from a tagged Git revision | Rust toolchain (rustup, cargo), a system linker, network access to GitHub and crates.io | Rust users, unusual platforms, anyone who wants to build exactly what they run | Longer first build and more disk use for the build cache. You may need extra system libraries if a dependency requires them. |
| Prebuilt release binary | Linux, macOS or Windows and the matching archive from the releases page | Quick setup on a common desktop or server | You depend on the published builds matching your OS and CPU architecture. Check the asset list on the release. |
Container image ghcr.io/sahenjp/rustxng |
Docker or another OCI-compatible runtime | Servers that already run containers, isolated deployments | Networking inside a container differs from the host. The loopback default needs attention, as explained below. |
Rust toolchain for the Cargo path
The standard way to install Rust is rustup, which installs rustc and cargo and keeps them updated. On Linux and macOS, the official installer is a shell script:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
On Windows, download rustup-init.exe from the official Rust website and run it. After installation, open a new terminal and confirm that the tools are on your path:
rustc --version
cargo --version
Use the current stable toolchain. If the project declares a minimum Rust version, it appears as a rust-version entry in its Cargo.toml, and Cargo refuses to build with an older compiler and tells you which version it needs. If you already have Rust installed, update it before building:
rustup update stable
A linker and build essentials
Rust needs a system linker to produce executables. On Debian or Ubuntu this comes from the build-essential package. On Fedora and similar systems, install gcc. On macOS, the Xcode Command Line Tools supply it (xcode-select --install). On Windows, rustup's default MSVC toolchain needs the Microsoft C++ build tools, and the rustup installer offers to set these up for you.
# Debian / Ubuntu
sudo apt update && sudo apt install -y build-essential pkg-config
# Fedora
sudo dnf install -y gcc pkgconf-pkg-config
Some Rust dependencies also link against system libraries such as OpenSSL. If the build stops with an error that names a missing library or pkg-config, install the development package your distribution provides for that library, for example libssl-dev on Debian and Ubuntu or openssl-devel on Fedora, and build again. The troubleshooting section covers this.
Localtonet account and client
For remote access, you need a Localtonet account, the Localtonet client installed on the machine running RustXNG and connected with that device's AuthToken. You can create an account on our registration page. A Custom subdomain needs balance on your account, and a Custom domain needs balance plus a domain added in DNS Manager. None of this is needed to install and test RustXNG locally, so you can postpone it until the service works.
Install RustXNG with Cargo
Cargo can install a binary crate straight from a Git repository. The RustXNG README describes installing from a tagged revision, so you build a known release rather than whatever is on the main branch at that moment. Pinning to a tag gives you reproducible installs and makes upgrades a deliberate choice.
Find the canonical repository URL
Use the repository URL exactly as the RustXNG README and releases page show it. Do not guess it from the project name: a URL such as https://github.com/RustXNG/RustXNG is not the project's published source. The container image lives under the sahenjp namespace on GitHub Container Registry, and GHCR package pages normally link to the source repository they were built from. If the image carries the standard OCI source label, you can also read the repository URL from it after pulling:
docker pull ghcr.io/sahenjp/rustxng
docker image inspect ghcr.io/sahenjp/rustxng \
--format '{{ index .Config.Labels "org.opencontainers.image.source" }}'
If that prints nothing, the label is not set, and the README remains the reference. Once you have the URL, open its releases page and note the newest tag.
Build and install
Pick the release tag
On the releases page, note the newest tag. At the time of writing it was v0.31.2. If the README's own install command differs from the form below, for example by adding --locked or a package name, use the README's version.
Run cargo install against the tagged repository
Cargo's --git and --tag options fetch and build a specific revision. Set the repository URL once in a shell variable, then run the command shown below these steps.
Note the executable name Cargo reports
When the build finishes, Cargo prints an "Installed package" line and the executable it placed in ~/.cargo/bin (or %USERPROFILE%\.cargo\bin on Windows). You need that exact name for the service file later.
Start the service
Run the installed executable in a terminal and leave it running. It should begin listening on 127.0.0.1:29483. Then move on to local verification.
# Paste the repository URL exactly as the RustXNG README shows it.
REPO_URL="https://github.com/OWNER/REPOSITORY"
# Build and install the tagged release you chose in step 1.
cargo install --git "$REPO_URL" --tag v0.31.2
Cargo's --locked flag makes the build use the dependency versions recorded in the project's Cargo.lock instead of resolving newer ones. It is a reasonable addition when the repository commits a lock file, and it makes builds more reproducible. If the repository contains more than one installable package, Cargo stops and lists the candidates. Add the package name the README specifies, or the one Cargo lists for the server, to the end of the command.
The first build downloads and compiles every dependency, so expect it to take several minutes on a typical machine and longer on small hardware such as a single-board computer. Later builds of new tags reuse parts of the cache and usually finish faster.
Confirm the installation and discover the options
Cargo keeps a record of everything it installs. To see the RustXNG package and the executable names it provided, run:
cargo install --list
ls ~/.cargo/bin
If your shell cannot find the executable, the Cargo bin directory is probably not on your PATH. rustup normally adds it, but you may need to open a new terminal or add $HOME/.cargo/bin to your shell profile yourself.
The defaults are enough for a working instance. Before customizing the listen address, the port or the enabled upstream engines, run the executable with --help. Rust command-line programs built with the common argument parsers print every supported flag this way, and many also list the environment variable each flag reads. Compare that output with the README for the tag you installed, because options can change between releases. If you change the port, use the new value everywhere this guide says 29483.
Alternative installs: release binary and Docker
Prebuilt release binaries
If you do not want a Rust toolchain, the releases page offers prebuilt builds for Linux, macOS and Windows. The process is the same on every platform:
- Open the release you want and download the asset that matches your operating system and CPU architecture. Asset names usually include the target, such as
x86_64oraarch64together withlinux,darwinorwindows. Checkuname -mon Linux and macOS if you are unsure of your architecture. - If the release lists a checksum file next to the archives, verify the download before you run it. On Linux,
sha256sum ARCHIVEcomputes the hash. On macOS, useshasum -a 256 ARCHIVE. On Windows, PowerShell'sGet-FileHash ARCHIVEdoes the same. The result must match the published value exactly. - Extract the archive and move the executable to a stable location, such as
/usr/local/binon Linux or a dedicated folder on Windows. - On Linux and macOS, make the file executable with
chmod +xif the archive did not preserve the permission. - Run it from a terminal. It listens on
127.0.0.1:29483, just like the Cargo build.
On macOS, Gatekeeper may block a downloaded binary that is not signed or notarized. If you trust the source, allow it in System Settings under Privacy and Security, or remove the quarantine attribute with xattr -d com.apple.quarantine on the file. On Windows, SmartScreen may show a warning for the same reason. These are operating system behaviors and tell you whether a given build is signed: if no warning appears, the OS accepted its signature.
The container image
The README lists a container image at ghcr.io/sahenjp/rustxng. One detail decides whether a container run works: the address the service binds to inside the container. A process that listens on 127.0.0.1 inside a container cannot be reached through Docker's published ports, because Docker forwards published traffic to the container's network interface, not to its loopback. Container images are usually built to listen on all interfaces for this reason. Prefer the README's run command if it gives one. Otherwise, start with this form, which publishes the port only on the host's loopback interface:
docker pull ghcr.io/sahenjp/rustxng
docker run -d --name rustxng --restart unless-stopped \
-p 127.0.0.1:29483:29483 \
ghcr.io/sahenjp/rustxng
# Confirm it started and is reachable from the host
docker logs rustxng
curl -i http://127.0.0.1:29483/
If the container runs but curl on the host gets "connection reset" or "empty reply", the service is most likely bound to loopback inside the container. Check docker logs rustxng for the address it reports and the --help output of the image's executable for a listen-address flag or environment variable, then pass the all-interfaces address (0.0.0.0) inside the container. The host-side 127.0.0.1 mapping keeps the service private either way.
A plain -p 29483:29483 mapping publishes the port on all host interfaces. On many Linux systems, Docker's own firewall rules can also bypass host firewalls such as ufw. If the machine has a public IP, your search instance could become reachable by anyone. Bind the published port to 127.0.0.1 and let the Localtonet tunnel handle remote access.
Verify RustXNG locally
Always confirm the service works on the host before you add a tunnel. If something breaks later, you will already know whether the problem is in RustXNG or in the remote path.
Check that the port is listening
While RustXNG is running, check that something is listening on port 29483. The command depends on your operating system:
# Linux
ss -ltnp | grep 29483
# macOS
lsof -iTCP:29483 -sTCP:LISTEN
# Windows (Command Prompt or PowerShell)
netstat -ano | findstr 29483
You should see a listener on 127.0.0.1:29483. If the output shows 0.0.0.0:29483 or [::]:29483, the service is listening on all interfaces. That is normal for a Docker proxy process when you used a loopback mapping, but for a native install it means the service is reachable from your network, and you should make that choice on purpose.
Check the web interface
Open http://127.0.0.1:29483/ in a browser on the same machine. You should see the RustXNG search page. Enter a test query and confirm that results appear. Successful results confirm the full chain: the service is up, it can reach the internet and at least one upstream engine answered. On a headless server, test with curl instead:
curl -i http://127.0.0.1:29483/
An HTTP 200 status with an HTML body means the web interface is being served.
Check the JSON search endpoint
The machine-readable endpoint is /search. The quickest way to learn its parameter names on your installed version is to run a search in the web interface and look at the browser's address bar, or the Network tab of the developer tools. The search form submits to the server with the query parameter it expects, and the README for your tag lists any additional parameter, such as one that selects JSON output. Put the same parameters into a curl request:
# Use the parameter names you saw in the address bar or the README.
# --get with --data-urlencode builds a correctly encoded query string.
curl -s --get "http://127.0.0.1:29483/search" \
--data-urlencode "PARAM=localtonet http tunnel" | jq .
A correct request returns JSON, and jq exits with an error if the body is not valid JSON. To see the response structure your agents will depend on, list its top-level fields and the fields of one result:
curl -s --get "http://127.0.0.1:29483/search" \
--data-urlencode "PARAM=test" | jq 'keys'
# If results are in an array field, inspect the first entry, for example:
curl -s --get "http://127.0.0.1:29483/search" \
--data-urlencode "PARAM=test" | jq '.[keys[0]] | if type == "array" then .[0] else . end'
Write down the field names you see, typically a list of results each carrying a title, a URL and a snippet. Your agent's tool definition should parse exactly these fields, and you should recheck them after every upgrade.
Metasearch depends on upstream engines that can be slow, rate limited or temporarily blocking automated traffic. If the interface loads but some queries return nothing, try a few different queries. Also check that the host has working outbound internet access and DNS before concluding the install is broken.
Run RustXNG as a background service
A terminal session is fine for testing, but a search endpoint your agents rely on should survive logouts and reboots. On Linux, systemd is the most common way to do that. Below is a unit file template in standard systemd syntax. It runs RustXNG with its defaults. Replace YOUR_USER with your user name and RUSTXNG_BINARY with the executable name you noted from cargo install --list. For a release binary, use its full path, for example under /usr/local/bin. You can print the full path with command -v followed by the executable name.
[Unit]
Description=RustXNG metasearch service
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=YOUR_USER
# Full path to the executable installed by Cargo or extracted from the release
ExecStart=/home/YOUR_USER/.cargo/bin/RUSTXNG_BINARY
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
If you configured options from the --help output, append those flags to ExecStart, or add Environment=NAME=value lines for options that are read from environment variables. Save the file as /etc/systemd/system/rustxng.service, then load and start it:
sudo systemctl daemon-reload
sudo systemctl enable --now rustxng
systemctl status rustxng
journalctl -u rustxng -f
Run the service as an ordinary, unprivileged user. Port 29483 is above 1024, so it needs no special privileges. On macOS, the equivalent tool is a launchd agent. On Windows, Task Scheduler with an "at startup" trigger or a service wrapper does the same job. The principle is the same everywhere: start automatically, restart on failure and keep logs where you can find them. The Localtonet client should also start automatically on the same host, otherwise the tunnel goes offline after a reboot even though RustXNG comes back.
Upgrading
For Cargo installs, upgrading means running cargo install again with the newer tag. Cargo normally replaces the previous build when the source revision changes. If it reports the package as already installed, add --force. Restart the service afterwards. Read the release notes before upgrading, because a fast-moving project can change defaults or the JSON output between releases, and your agents may depend on the old format. Rerun the jq 'keys' check from the verification section after each upgrade.
For release binaries, download the new archive, verify it, replace the executable and restart. For the container, pull the new image and recreate the container. Pinning a specific image tag instead of a floating latest tag, when the registry publishes version tags, keeps upgrades deliberate.
Uninstalling
To remove a Cargo install, use cargo uninstall with the package name shown by cargo install --list. Then stop and disable the systemd unit if you created one (sudo systemctl disable --now rustxng), and delete the unit file. Release binaries are removed by deleting the executable. Containers are removed with docker rm -f rustxng and the image with docker rmi ghcr.io/sahenjp/rustxng. Delete the Localtonet tunnel too, so the public address is released.
Remote access to RustXNG with Localtonet

Once RustXNG answers on http://127.0.0.1:29483/, you can make it reachable from outside. An HTTP tunnel is the right tunnel type here. RustXNG speaks plain HTTP, and our HTTP tunnel publishes it at a public HTTPS address with a certificate we provide and renew, so RustXNG itself needs no TLS setup. Your remote browsers and agents talk to an HTTPS URL while RustXNG stays on loopback.
Before you start: the Localtonet client must be installed on the RustXNG host and connected with that device's AuthToken. The service listens on 127.0.0.1, so the client has to run on the same machine. For a container published on the host's loopback, run the client on the host. Then follow the documented sequence from the Localtonet HTTP tunnel documentation:
Open the HTTP page
In the dashboard, open My Tunnels › HTTP and select Create HTTP Tunnel to open the form.
Choose the URL type
Pick Random subdomain (a generated name on the selected domain, nothing extra needed), Custom subdomain (a name you type, letters, digits and hyphens allowed, which needs balance on your account) or Custom domain (a domain of your own, which needs balance and a domain added in DNS Manager).
Choose the device and the region
In Device token, select the token used by the Localtonet app on the RustXNG host. In Server region, choose a region close to that device for lower latency.
Enter the local address and create the tunnel
Set Domain (and Subdomain for a Custom subdomain) as applicable, enter 127.0.0.1 as the Local IP address and 29483 as the Local port, then select Create tunnel. The tunnel appears under Your tunnels as Tunnel # followed by its ID.
Start the tunnel
Select the start button in the Actions column. When the tunnel runs, its address in the URL column becomes a link. If the Localtonet app of that token is offline, a dialog tells you so: start the app, or select Start anyway and the tunnel goes live when the app connects.
When you no longer need remote access, stop the tunnel from the Actions column. The public path disappears immediately while RustXNG keeps running locally. Delete the tunnel entirely when the remote endpoint is no longer needed. Stopping and starting does not change the address: an HTTP tunnel keeps its subdomain until you delete it, so agent configurations that point at it stay valid across restarts.
Settings worth changing for a search endpoint
Select the settings button in the Actions column to open the Tunnel settings panel. Several settings matter for RustXNG:
| Setting | What it does | Recommendation for RustXNG |
|---|---|---|
| Is Only Https? | Serves the public URL over HTTPS only. A request to http:// is redirected to https://. While it is off, the address answers on both. |
Turn it on, especially once you add Basic Authentication, so credentials and queries never travel in clear text. |
| HTTP Timeout | Sets how long our server waits for a response from your local application, from 1 to 600 seconds. | Metasearch waits on several upstream engines. If slow queries fail remotely but succeed locally, raise the timeout to cover your slowest normal queries. |
| Headers | Manages custom request and response headers, including overriding the Host header your service receives. | Only needed if RustXNG reacts badly to the tunnel host name (see below). |
| Is HTTP/3 Active? | Lets clients reach the public URL over HTTP/3. A new tunnel has it turned on. | Leave it on. Turn it off only if a client has trouble with HTTP/3. |
| Tunnel Details | Renames the tunnel and changes the local IP address and local port. | Use this if you change RustXNG's port or move it behind a local proxy, instead of creating a new tunnel and getting a new address. |
The Host header
Your service receives the host name the visitor used, which is the tunnel address, not 127.0.0.1:29483. Some local web servers pick a site by host name, validate it, or build absolute links from it, and answer with an error or wrong links when the name is unexpected. If the RustXNG interface loads locally but returns errors or broken links through the tunnel, open Headers in the tunnel settings and add a request header named Host with the value your server expects, such as 127.0.0.1:29483. RustXNG then receives that host name instead of the tunnel address.
The warning page on the Free plan
Our HTTP tunnel documentation has a section titled "The warning page on the Free plan" that describes a warning page shown to visitors of Free plan tunnels. For a person in a browser this is a one-time interruption. For an AI agent or script it matters more: a warning page is HTML, so a program that expects JSON from /search may receive an HTML page instead and fail to parse it. If your agent reports JSON parse errors through the tunnel while the same local request works, print the raw response with curl -i and check whether it is the warning page. Read that documentation section for the current behavior and how to avoid the page for programmatic clients before you rely on a Free plan tunnel for unattended agents.
Verify the remote path
Test from a device that is not on your local network, such as a phone on mobile data. Load the public address in a browser and run a search. Then repeat the JSON request from the local verification section, replacing http://127.0.0.1:29483 with your tunnel's HTTPS address. If the local request worked and the remote one does not, the problem is in the tunnel path, not in RustXNG. Check that the client is connected and the tunnel is running. The Request Log in the tunnel settings shows whether requests reached the tunnel at all, which quickly separates "nothing arrives" from "RustXNG answered with an error".
Get notified when the endpoint goes up or down
Agents that depend on your search endpoint fail in confusing ways when it silently disappears. Our platform-wide webhooks can tell you. A webhook belongs to a token group: it watches the AuthTokens in that group, the tunnels of those tokens, or both. You create it under Webhooks in the dashboard menu by enabling Token Webhook and/or Tunnel Webhook, choosing Send When Connected and/or Send When Disconnected, selecting the Auth Token Group and entering the Webhook URL. The Webhooks menu item is only available in your own account dashboard, not while you work in a team dashboard.
Each notification is a POST with a JSON body containing Id (the AuthToken for token events, or the numeric tunnel ID sent as a string for tunnel events), ActionDate in ISO 8601 format, Type (Token or Tunnel) and Status (Connected or Disconnected). Keep these delivery rules in mind:
- No retries. A failed call is not repeated, so your receiver should be available and answer quickly.
- No signature. The request carries no signature or secret header. Put a long random value into the webhook URL, as a path segment or query parameter, and check it in your receiver.
- No editing. A webhook cannot be edited. To change its URL, group or switches, delete it and create a new one.
- Slight delay on disconnect. A disconnect is reported when Localtonet registers that the client is gone, which can be a little later than the moment the device lost its connection.
Setup and a sample receiver are in the Localtonet webhook documentation. These Token and Tunnel webhooks are separate from the File Server webhooks, which are the ones that support HMAC signing.
An HTTP tunnel publishes one service at a public address. It does not join remote devices to your network. If you would rather keep RustXNG off the public internet entirely and reach it only from your own devices, our VPN Manager provides a private mesh network with firewall rules. That is a different feature with a different setup from the HTTP tunnel described here.
Secure the public endpoint

Once the tunnel is running without access controls, anyone who knows the address can send requests to your RustXNG instance. A tunnel moves traffic. It does not add authorization that your service lacks, so think about who should be able to search through your machine before leaving the tunnel running. Assume RustXNG itself has no authentication or rate limiting unless its --help output or README for your version documents them.
Understand the risks specific to metasearch
- Your IP carries the reputation. Every remote query produces outbound requests from your host to upstream engines. Heavy or abusive traffic from strangers can get your IP rate limited or blocked, which also hurts your own searches.
- Automated discovery. Public URLs get probed by scanners. An open search endpoint is attractive to people who want free scraping capacity.
- Agent loops. A misbehaving AI agent can issue hundreds of queries in a short time. Even legitimate use can trigger upstream limits.
Built-in tunnel controls
Every HTTP tunnel has per-tunnel controls in its Tunnel settings panel. These are the first place to protect RustXNG, because they act at our server before a request travels down the tunnel. Availability of individual options can depend on your plan, so check the dashboard for what your account offers.
curl -u. Combine it with Is Only Https?.
For most RustXNG setups, a good baseline is Is Only Https? turned on, Basic Authentication with a long random password, and IP Restriction if your callers have stable addresses. A remote check then looks like this:
# Without credentials the request should be rejected
curl -i "https://YOUR-TUNNEL-ADDRESS/"
# With credentials it should reach RustXNG
curl -i -u "AGENT_USER:LONG_RANDOM_PASSWORD" "https://YOUR-TUNNEL-ADDRESS/"
Habits that complement the controls
- Run the tunnel only when needed. The public address only works while the tunnel is running, so stopping it when nobody needs remote access is the simplest control you have. Expiration Date automates this for temporary access.
- Do not share the address publicly. A subdomain is not a secret, but avoid posting it in public repositories, issue trackers or agent configurations that others can read.
- Watch your logs. Review the Request Log and the RustXNG service logs (through
journalctlif you used systemd) for unexpected query volume. - Keep the device token private. Anyone with your AuthToken could run tunnels as that device. Store it like any other secret.
Alternative: your own reverse proxy
If you need behavior the tunnel controls do not offer, such as a custom header token scheme or per-client rate limits, you can run a local reverse proxy like Caddy or nginx on another loopback port. Have it enforce your rule and forward to 127.0.0.1:29483, then change the tunnel's local port in Tunnel Details to the proxy's port. This is optional. For most people the built-in controls are enough and keep the setup to a single moving part.
If you need the endpoint available around the clock for agents in the cloud, enable Basic Authentication or IP Restriction on the tunnel before you leave it running. An open metasearch endpoint can be abused, and the consequences land on your IP address and your upstream access.
Using the endpoint from AI agents
The /search endpoint is the part of RustXNG built for programs. Most agent frameworks let you define a custom tool that makes an HTTP GET request and returns the response body to the model. In practice, the tool definition needs five things:
- The base URL: your Localtonet HTTPS address, or
http://127.0.0.1:29483if the agent runs on the same machine. - The path
/searchand the parameter names you confirmed during local verification. - The Basic Authentication credential configured on the tunnel, supplied from an environment variable or secret store rather than hard-coded.
- A client timeout a little longer than the tunnel's HTTP Timeout, so the agent sees a clear error instead of hanging. Handle timeouts gracefully and do not retry in a tight loop.
- A check that the response is JSON before parsing. If the body is HTML, the agent hit a login prompt, an error page or the Free plan warning page rather than RustXNG.
# The request an agent tool makes, expressed as curl
curl -s --get "https://YOUR-TUNNEL-ADDRESS/search" \
-u "$RUSTXNG_USER:$RUSTXNG_PASSWORD" \
--max-time 90 \
--data-urlencode "PARAM=latest rust release notes" \
-H "Accept: application/json" | jq .
Agents that run on your own machine should use the loopback address directly. Routing them through the public tunnel adds a round trip and an exposure you do not need. The tunnel is for agents and people somewhere else, such as a cloud-hosted agent, a teammate's laptop or your phone.
If you use an AI coding assistant, our Localtonet MCP Server lets assistants such as Claude Code create, start and stop Localtonet tunnels from the conversation. That fits the "open only when needed" approach: the assistant can start the RustXNG tunnel at the beginning of a research task and stop it afterwards. Because the subdomain persists across stops and starts, the agent's tool configuration does not need to change.
Troubleshooting
Most problems fall into one of three layers: the build, the local service or the remote path. Work through them in that order, because each layer depends on the one before it.
| Symptom | Likely cause | What to do |
|---|---|---|
cargo: command not found |
Rust is not installed, or ~/.cargo/bin is not on PATH |
Install Rust with rustup, open a new terminal, or add the Cargo bin directory to your shell profile. |
cargo install fails to fetch the repository |
Wrong or guessed repository URL, or a tag that does not exist | Copy the URL exactly from the README and the tag exactly from the releases page. |
Build fails with linker `cc` not found or a link.exe error |
No system linker | Install build-essential or gcc on Linux, the Xcode Command Line Tools on macOS, or the Microsoft C++ build tools on Windows. |
Build error mentioning pkg-config or a missing library |
A dependency needs a system development package | Install pkg-config and the development package named in the error, for example libssl-dev or openssl-devel for OpenSSL, then rebuild. |
| Error that a package requires a newer rustc | Toolchain older than the project's minimum Rust version | Run rustup update stable and rebuild. |
| Cargo asks you to choose a package | The repository contains several installable packages | Add the package name from the README or from Cargo's list to the install command. |
| Startup error saying the address is already in use | Another process, or an earlier RustXNG instance, holds port 29483 | Find it with ss, lsof or netstat and stop it. Check that a systemd copy or container is not already running. |
| Page loads but searches return no results | No outbound internet or DNS, or upstream engines limiting requests | Test outbound connectivity from the host, try different queries and reduce query volume. |
| Docker container runs but the host cannot connect | Service binds to loopback inside the container, or the port is not published | Check docker logs for the bind address, set it to 0.0.0.0 inside the container and publish with a 127.0.0.1 host mapping. |
| Public address does not load | Tunnel created but not started, client disconnected, or wrong local target | Start the tunnel from the Actions column, confirm the client is connected and check the target is 127.0.0.1 and 29483. |
| A dialog says the Localtonet app is offline when you start the tunnel | The client for the selected Device token is not running or not connected | Start the client on the RustXNG host, or select Start anyway and the tunnel goes live when the app connects. |
| Browser works remotely but the agent gets HTML instead of JSON | The Free plan warning page, a Basic Authentication prompt or an error page | Inspect the raw response with curl -i. See "The warning page on the Free plan" in the HTTP tunnel docs, and make sure the agent sends its credentials. |
| Slow searches fail remotely but work locally | The request exceeds the tunnel's HTTP Timeout | Raise HTTP Timeout in the tunnel settings (1 to 600 seconds) and keep the agent's own timeout slightly longer. |
| Remote pages show errors or broken links while local access is fine | RustXNG reacts to the tunnel host name in the Host header | Open Headers in the tunnel settings and add a Host request header with the value the server expects, such as 127.0.0.1:29483. |
| Public address works but agents get unexpected responses | Wrong query parameters, or the agent is rejected by an access control | Repeat the exact request with curl, compare it with the local request and check the Request Log. |
A reliable diagnostic order
When something is wrong and you are not sure where, check these in sequence. First, is the RustXNG process running, and do its logs show errors? Second, does curl -i http://127.0.0.1:29483/ succeed on the host? Third, is the Localtonet client connected and the tunnel running? Fourth, does the Request Log show the remote request arriving? Finally, does the public address work from an outside network with the right credentials? The first failing check tells you which layer to fix.
Frequently asked questions
What port does RustXNG use by default?
RustXNG starts an HTTP service on 127.0.0.1:29483, with the web interface at / and the JSON search endpoint at /search. Run the executable with --help to see the options for changing the address or port on your version.
Which repository URL should I use with cargo install?
Use the URL exactly as the RustXNG README and releases page show it, together with a release tag such as v0.31.2 or newer. Do not guess it from the project name. The container image is published under the sahenjp namespace on GHCR, and its package page or OCI source label can confirm the linked repository.
Should I install with Cargo, the release binary or Docker?
Use the release binary for the fastest setup on Linux, macOS or Windows. Use Cargo if you already work with Rust, want to build from a pinned tag yourself or need a platform without a prebuilt build. Use the ghcr.io/sahenjp/rustxng image if your server already runs containers, and publish its port only on the host's loopback.
Why must the Localtonet client run on the same machine as RustXNG?
RustXNG listens on the loopback address 127.0.0.1, which only accepts connections from the same host. Our HTTP tunnel forwards to a local IP and port that the client device can reach, so the client needs to be on that host.
How do I add authentication to my RustXNG endpoint?
Assume RustXNG has no built-in authentication unless your version documents it. The simplest option is the tunnel's own controls: enable Basic Authentication and Is Only Https?, and add IP Restriction if your agents have fixed addresses. SSO Providers suit people using the web interface. A self-managed reverse proxy remains an alternative when you need custom rules.
Does the public address change when I stop and start the tunnel?
No. An HTTP tunnel keeps its subdomain until you delete the tunnel. The address works only while the Localtonet client is connected and the tunnel is running. Token and Tunnel webhooks can notify you when the status changes to Connected or Disconnected, but failed webhook calls are not retried.
Which query parameters does the /search endpoint accept?
Run a search in the web interface and read the parameters from the address bar or the browser's Network tab, and check the README for your tag for options such as JSON output. Test them locally with curl and jq, then use the same request against the tunnel address.
Why do slow searches time out through the tunnel?
Our server waits for your local application only as long as the tunnel's HTTP Timeout allows. You can set it from 1 to 600 seconds in the tunnel settings. Raise it if metasearch queries regularly take longer than the current value.
Can I use a custom domain for my RustXNG instance?
Yes. HTTP tunnels support Random subdomain, Custom subdomain and Custom domain URL types. A Custom domain needs balance on your account and a domain added in DNS Manager. A Custom subdomain needs balance only.
Put your RustXNG instance within reach
Your metasearch endpoint is running locally. Create a Localtonet HTTP tunnel to 127.0.0.1:29483, protect it with Basic Authentication or IP Restriction, and give your remote browsers and AI agents a stable HTTPS address that you can start and stop whenever you choose.
Get Started Free →Corrections & updates
Substantive changes approved by the Localtonet editorial team are listed transparently below.
Localtonet is a secure multi-protocol tunneling and proxy platform designed to expose localhost, devices, private services, and AI agents to the public internet supporting HTTP/HTTPS tunnels, TCP/UDP forwarding, mobile proxy infrastructure, file server publishing, latency-optimized game connectivity, and developer-ready AI agent endpoint exposure from a single unified control plane.