No KYC · email optional · pay in Monero, Bitcoin or USDT
Language: English
Deploy a VPS

Guide · Self-hosting · checked 2026-11-10

How do I self-host SearXNG on a VPS?

SearXNG is a metasearch engine you run yourself. This guide installs it from the official container image and keeps it private behind an SSH tunnel.

Last updated: · 6 min read

Quick answer

How do I self-host SearXNG on a VPS?

To self-host SearXNG on a VPS, install Docker and run the docker.io/searxng/searxng image with the port bound to 127.0.0.1:8888, then open it through an SSH tunnel. A Gloamport Gloam plan, 2 vCPU, 4 GB RAM, 80 GB NVMe, 4 TB traffic, costs $8.25 a month on the 12-month term and holds it with room to spare.

What does a self-hosted SearXNG need?

ItemValueSource
Imagedocker.io/searxng/searxng:latest (mirror: ghcr.io/searxng/searxng)SearXNG container docs
Container port8080, published on the host as 127.0.0.1:8888SearXNG container docs
Config folder/etc/searxng/ in the container, ./config/ on the hostSearXNG container docs
Data folder/var/cache/searxng/ in the container, ./data/ on the hostSearXNG container docs
Secretserver.secret_key, or the SEARXNG_SECRET variableSearXNG installation docs
Output formatshtml only by default; json must be added to search.formatsSearXNG installation docs
Suggested planGloam: 2 vCPU, 4 GB RAM, 80 GB NVMe, 4 TB trafficGloamport plan list

Prices checked on

What is SearXNG, and why host it yourself?

SearXNG is a free metasearch engine: it sends your query to many search engines and returns one merged page. Its documentation describes it as a privacy-respecting metasearch engine. Hosting it yourself means the instance has one user, you, and you decide its settings.

A caveat comes first. The upstream engines still receive the query, from your VPS address instead of your own. Your VPS provider sees the traffic to the VPS. Self-hosting changes who sees what; it does not remove the search engines from the picture. Gloamport sells the server and nothing on top of it; the software is yours to run.

How to self-host SearXNG on Debian 13 or Ubuntu 24.04

Five steps, about fifteen minutes on a fresh VPS.

  1. Log in and update the system

    SSH to the VPS as root with your key and run apt update and apt upgrade. Setup time: 1 hour at most after the payment is confirmed; most VPS are running within a few minutes.

  2. Install Docker Engine

    Add Docker’s apt repository by following the official install page for your system (Debian 13 and Ubuntu 24.04 are both supported), then install the packages shown in the code block below.

  3. Create the folders and a secret

    Make a searxng folder with config and data inside, and generate a random secret with openssl rand -hex 32. Keep the secret in a root-only file so you can recreate the container later.

  4. Start the container

    Run the docker run command in the code block. The -p option publishes the container port 8080 on 127.0.0.1:8888, so nothing outside the VPS can reach it. The restart policy brings it back after a reboot.

  5. Open it through an SSH tunnel

    On your own computer, run the ssh -L command in the code block, then browse to http://127.0.0.1:8888. Close the tunnel when you are done, or leave it open as a background session.

On the VPS: Docker, folders, container
# After adding Docker's apt repository (docs.docker.com/engine/install/debian/)
sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Folders and a secret
mkdir -p ~/searxng/config ~/searxng/data
cd ~/searxng
umask 077; openssl rand -hex 32 > secret.txt

# Container, published on loopback only
sudo docker run --name searxng -d --restart unless-stopped \
  -p 127.0.0.1:8888:8080 \
  -e SEARXNG_SECRET="$(cat secret.txt)" \
  -v "./config/:/etc/searxng/" \
  -v "./data/:/var/cache/searxng/" \
  docker.io/searxng/searxng:latest

# Check it answers locally
curl --head 127.0.0.1:8888
On your computer: the SSH tunnel
ssh -N -L 8888:127.0.0.1:8888 root@YOUR_VPS_IP

Should the instance be public or private?

Keep it private unless you have a reason not to. A public instance gets crawled and abused by bots, and the SearXNG documentation ships a limiter setting for that, switched off in its template (server.limiter, default false). A one-user instance behind an SSH tunnel needs no limiter and no certificate.

If you want to reach it from a phone without a tunnel, put a reverse proxy with HTTPS in front and add a password; that work is outside this guide. For a browser that already goes through your VPS, combine this with How do I use SSH as a SOCKS proxy through my VPS? and open the same tunnel for both.

How much server does SearXNG use?

A single-user instance fits in a small plan, and Gloam leaves room for other services. We give no benchmark figures: size the plan by what you run next to it. Gloamport lists Gloam as the plan for A Matrix server, Vaultwarden and SearXNG together, at $8.25 a month on the 12-month term ($16.50 on a single month).

If SearXNG is the only service, Dusk (1 vCPU, 2 GB RAM, 40 GB NVMe, 2 TB traffic, $5.25 a month on the 12-month term) is the smaller choice. Check the load with docker stats after a week and move up if memory is short. The pricing page lists every size and term.

How do you update and secure a self-hosted SearXNG?

Update by pulling the image again and recreating the container, and secure it by keeping the port on loopback. Because the secret is passed by variable and the folders are mounted from the host, recreating the container loses nothing. Run docker pull on the image, remove the old container with docker rm -f searxng, and repeat the docker run command.

Secure the host as well: SSH by key only, no password logins, and a firewall that allows SSH. See How do I harden SSH on a new VPS?. According to Gloamport’s survey of 10 November 2026, 28 of the 49 providers ask for no ID document at sign-up; the server itself is yours to secure either way.

In summary
  • SearXNG runs from docker.io/searxng/searxng with the config in /etc/searxng/.
  • Publish it as 127.0.0.1:8888:8080 so only the VPS itself can reach it.
  • Set a random secret; the SEARXNG_SECRET variable overrides server.secret_key.
  • Reach it from your computer with ssh -N -L 8888:127.0.0.1:8888.
  • The upstream search engines still see your queries, from the VPS address.
  • Gloam, $8.25 a month on 12 months, runs it beside other services.
  • Update by pulling the image and recreating the container.

Self-hosting SearXNG: common questions

Do I need a domain name?

No, not behind an SSH tunnel. You open http://127.0.0.1:8888 on your own computer. A domain and a certificate matter only if you expose it on the public internet.

Can I use Docker Compose instead?

Yes. The SearXNG container page recommends Compose and gives a command to fetch its docker-compose.yml and .env.example. The single docker run command above is the manual route from the same page.

How do I enable the JSON output?

Add json under search.formats in settings.yml. The template enables html only, and removing a format denies access to it.

Does self-hosting make my searches private?

It removes a shared public instance from the path. The search engines SearXNG queries still receive each query, and the VPS provider sees the connection to the VPS.

Which operating systems work?

Gloamport images: Linux only: Debian, Ubuntu, AlmaLinux and Rocky Linux images. No Windows. The container runs the same on Debian 13 and Ubuntu 24.04.

Sources (4)
  1. SearXNG documentation: Installation container — SearXNG project (checked 2026-11-10)
  2. SearXNG documentation: Step by step installation — SearXNG project (checked 2026-11-10)
  3. Install Docker Engine on Debian — Docker Inc. (checked 2026-11-10)
  4. ssh(1) manual page: -L, -N — OpenBSD / OpenSSH (checked 2026-11-10)

From $3.74/month · no KYC

Deploy a VPS