Skip to content

How to Set Up SearXNG on a Linux Server – Your Own Metasearch Engine Without Tracking

Set up SearXNG on your Linux VPS: install it as a One-Click App with HTTPS or manually using Docker Compose. Configure bot protection, a private instance with Basic Auth, your browser’s default search engine, language, and search services.

27 November 202612 min read1 Views0 helpful

Introduction

SearXNG is a free metasearch engine. It sends your search query to many search services at the same time, such as Google, Brave, DuckDuckGo, or Wikipedia, and displays the combined results on a single page. The search services only see your server, not you: they don’t receive your IP address or cookies, or a profile of your browser. There are no ads or personalized results.

In this guide, we’ll show you two ways to set it up: the easy way, as a One-Click App that makes SearXNG available over HTTPS in just a few clicks, and a manual installation with Docker Compose based on the official container guide. After that, you’ll set up SearXNG as your browser’s default search engine, customize the language and search services, and protect your instance from unauthorized access.

When It Makes Sense to Run SearXNG on a VPS

There are many public SearXNG instances. Running your own instance on a VPS is worthwhile if:

  • You don’t want to entrust your searches to someone else. With a public instance, the operator can see what you search for. With your own instance, your searches stay on your server.
  • You want to choose which search services are queried, the language used for searches, and how the results are displayed.
  • You want search to work the same way on all your devices—your PC, laptop, and smartphone—without an account or extension.
  • You want to use search results in your own scripts or tools. SearXNG can also provide results in JSON, CSV, or RSS format.

Running your own instance is less suitable if you want to search completely anonymously. All requests to Google and other services come from your VPS’s IP address. If you’re the only person using the instance, searches can be associated with that address. Also, some search services temporarily block requests from server addresses with CAPTCHAs. See “Limitations” below for more information.

Private or Public?

Make the most important decision before setting things up: who can use your instance? SearXNG doesn’t include user accounts or a login. Anyone who knows the address can search.

Just for you (private)Public for everyone
AccessAuthentication through a reverse proxy (Basic Auth) or an address you don’t shareOpen to everyone
Bot protection (limiter)Not needed if authentication is set up in front of itEssential
RiskLowBots flood the instance, and search services block your server’s IP

For everyday use, we recommend a private instance. If you want to make SearXNG publicly available, enable the limiter and be prepared to spend time maintaining it.

The Easy Way: SearXNG as a One-Click App

The quickest way to get SearXNG running is through your VPS’s One-Click Apps. The app installs SearXNG along with Valkey, the database required for bot protection. It’s accessible directly over HTTPS using a domain, and the instance’s secret key is generated automatically. You don’t need to configure a reverse proxy, certificate, or firewall rules.

Requirements

  • A Linux VPS (Debian or Ubuntu) with One-Click Apps set up. For instructions, see Set Up One-Click Apps.

Install

  1. Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
  2. Search the app catalog for SearXNG and click Install app.
  3. Use a custom subdomain or zap.cloud is already selected, with a randomly generated name. Leave this option enabled or enter your own name: you’ll use the domain to access SearXNG over HTTPS. If you choose your own name, don’t pick one that’s easy for others to guess.
  4. You don’t need to enter anything under App configuration. Leave SEARXNG_BIND_ADDRESS set to 0.0.0.0. The instance’s secret key (SERVICE_PASSWORD_SEARXNGSECRET) is generated automatically.
  5. Click Queue installation. SearXNG should show as online on the app card after one or two minutes.
Info

The INSTANCE_NAME field The form displays the INSTANCE_NAME field with the default value coolify. SearXNG doesn’t use this variable, so your instance will still be called “SearXNG” in your browser. You can leave this field as it is.

First Visit

Open the app’s Access link. You’ll go straight to the search page; there’s no login. Enter a search term and press Enter. Below each result, you’ll see which search services provided it. Use the tabs at the top to switch between categories such as Images, Videos, News, or Map.

Enable Wikipedia and Maps

By default, the One-Click App doesn’t return results from Wikipedia, Wikidata, or OpenStreetMap. These search services require your instance to provide a contact address. Here’s how to add one:

  1. Open the app settings (gear icon) and go to App environment.
  2. Click the plus icon under Custom environment variables.
  3. Enter SEARXNG_CONTACT_URL as the key and a contact address as the value, for example mailto:you@example.com.
  4. Click Save. SearXNG will restart and then query Wikipedia, Wikidata, and OpenStreetMap as well.

Enable Bot Protection

By default, SearXNG’s bot protection, the limiter, is disabled in the One-Click App. This means anyone who knows your address can send as many requests through your server as they like. This can lead to Google and other search services blocking your server’s IP. You can enable the limiter by adding a custom environment variable as described above: set SEARXNG_LIMITER to true. The app already includes the required Valkey database.

Afterward, SearXNG will respond to automated requests, such as those from scripts using curl, with error 429 (Too Many Requests). Regular searches in your browser will continue to work.

Warning

SearXNG doesn’t have a login Even with the limiter enabled, anyone who knows your instance’s address can search through your server. Don’t share the access link. If you want to be the only person who can search, use the manual installation and set up authentication in the reverse proxy, as described below under “Keep Your Instance Private.”

Updates and Backups

Update SearXNG in the app settings (gear icon), under App update. Click Check for updates, then install a new version using Apply update. If you see a message saying the app is up to date, there isn’t a newer version in the app catalog yet.

SearXNG doesn’t store accounts or search histories on the server. Your personal settings, such as language or search services, are stored as a cookie in your browser. There’s very little to back up, so just make a note of any custom environment variables you’ve set under App environment.

Manual Installation

The rest of this guide covers a manual installation of SearXNG with Docker Compose on your VPS. This is useful, for example, if you don’t use One-Click Apps on your server or want to protect your instance with a login.

Requirements

  • A Linux VPS running Debian or Ubuntu, with SSH access. See First SSH Access.
  • Docker and Docker Compose. See Install Docker. Check the installation with docker --version and docker compose version.
  • For HTTPS: a domain or subdomain whose A record points to your VPS’s IP address (e.g., search.example.com).

The official documentation doesn’t specify minimum hardware requirements. SearXNG doesn’t store search results permanently, so it requires little disk space. The amount of processing power you need depends mainly on how many people search at the same time.

Prepare the Firewall

SearXNG listens on port 8080 inside the container. You don’t need to open this port if you use a reverse proxy as described below. With ufw, allow only SSH and the ports used by the reverse proxy:

Code
ufw allow OpenSSH
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
Warning

Docker bypasses ufw Ports published by Docker using ports: are accessible externally even if ufw blocks them. Docker adds its own rules before the ufw rules. For this reason, bind SearXNG to 127.0.0.1 as shown in the Compose file below. For more information about the firewall, see Manage the Firewall on Linux.

Install with Docker Compose

Create a directory for SearXNG with a subdirectory for its configuration, then change to that directory:

Code
mkdir -p /opt/searxng/core-config
cd /opt/searxng

Create the Compose file using nano docker-compose.yml. It’s based on the official Compose template, with a fixed version and a port that’s only accessible locally:

Code
name: searxng

services:
  core:
    container_name: searxng-core
    image: docker.io/searxng/searxng:2026.11.15-2d500cb6b
    restart: always
    ports:
      - 127.0.0.1:8080:8080
    environment:
      - SEARXNG_BASE_URL=https://search.example.com/
    volumes:
      - ./core-config/:/etc/searxng/
      - core-data:/var/cache/searxng/

  valkey:
    container_name: searxng-valkey
    image: docker.io/valkey/valkey:9-alpine
    command: valkey-server --save 300 1 --save 60 1000 --loglevel warning
    restart: always
    volumes:
      - valkey-data:/data/

volumes:
  core-data:
  valkey-data:

Here’s what the entries mean:

  • image: the official searxng/searxng image in a fixed version, also used by the One-Click App. You can find the versions on Docker Hub.
  • 127.0.0.1:8080:8080: the search page is accessible only from the server itself; external access goes through the reverse proxy.
  • SEARXNG_BASE_URL: the address where your instance will be available. Replace search.example.com with your domain.
  • ./core-config/: this is where the configuration file settings.yml is stored.
  • valkey: the database required for bot protection (the limiter).

Start the containers:

Code
docker compose up -d

On the first start, SearXNG creates the file core-config/settings.yml and replaces the placeholder for the secret key (secret_key) with a random value. Check whether everything is running with docker compose ps, and view SearXNG’s messages with docker compose logs -f core.

First Visit

Because SearXNG listens only on 127.0.0.1, use an SSH tunnel to access the search page for the first time. Run this command on your own computer:

Code
ssh -L 8080:localhost:8080 root@SERVER_IP

Replace SERVER_IP with your VPS’s IP address, then open http://localhost:8080 in your browser. If you see the search page, the installation is working.

Basic Settings in settings.yml

Open the configuration with nano core-config/settings.yml. It starts with use_default_settings: true: SearXNG uses all the default values, and you only need to specify what you want to change. Here’s a useful starting point for your own server:

Code
use_default_settings: true

general:
  instance_name: "Meine Suche"
  contact_url: "mailto:du@example.com"

server:
  secret_key: "DEN_ERZEUGTEN_SCHLÜSSEL_BEHALTEN"
  limiter: true
  image_proxy: true

valkey:
  url: valkey://valkey:6379/0

search:
  default_lang: "de"

ui:
  default_locale: "de"
  • secret_key: keep the value generated by SearXNG on the first start. The default ultrasecretkey must not be left in place.
  • contact_url: Wikipedia, Wikidata, and OpenStreetMap return results only if a contact address is set.
  • limiter and valkey: enable bot protection and connect it to the valkey service from the Compose file.
  • default_lang and default_locale: the search language and interface language.

If SearXNG is running behind the reverse proxy described in the next section, the limiter needs visitors’ real IP addresses. To configure this, create the following file with nano core-config/limiter.toml:

Code
[botdetection]
trusted_proxies = [
  '127.0.0.0/8',
  '::1',
  '172.16.0.0/12',
]

By default, Docker assigns internal network addresses from the 172.16.0.0/12 range. This tells SearXNG to trust the X-Forwarded-For and X-Real-IP headers sent by nginx. Apply the changes with docker compose restart core.

Access Over HTTPS Through a Reverse Proxy

To access SearXNG without a tunnel, put a reverse proxy with a valid certificate in front of it. For the basics, see Set Up a Reverse Proxy with nginx and Create an SSL Certificate (Let's Encrypt). The nginx server block forwards the headers required by the official documentation for the limiter:

Code
server {
    listen 80;
    server_name search.example.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header Connection $http_connection;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Then obtain the certificate with certbot --nginx -d search.example.com. Certbot will add HTTPS and HTTP redirection to the block. Make sure SEARXNG_BASE_URL in the Compose file matches this address exactly.

Keep Your Instance Private

If you’re the only person who should be able to use your instance, add username-and-password authentication (Basic Auth) in the reverse proxy. Install the tool for creating the password file and add a user:

Code
apt install apache2-utils
htpasswd -c /etc/nginx/searxng.htpasswd DEIN_NAME

Add these two lines to the location block in your server block, then reload nginx with systemctl reload nginx:

Code
auth_basic "SearXNG";
auth_basic_user_file /etc/nginx/searxng.htpasswd;

The first time you visit, your browser will ask for a username and password. For more tips on securing your server, see Linux Security Tips.

Back Up Your Data

SearXNG doesn’t store accounts or search histories. Your configuration files are the only important data. Back up the directory containing the Compose file and configuration:

Code
cd /opt
tar -czf searxng-backup-$(date +%F).tar.gz searxng/docker-compose.yml searxng/core-config

The core-data and valkey-data volumes contain only cached data, such as favicons and limiter data. You don’t need to back them up.

Update SearXNG

SearXNG releases a new version almost every day. Update the version number in docker-compose.yml and restart the containers:

Code
cd /opt/searxng
docker compose pull
docker compose up -d

The official documentation recommends checking the current Compose template when updating to see whether anything has changed. Remove old images with docker image prune.

Using SearXNG Every Day

Once you’ve set things up, make SearXNG your everyday search engine and customize it to suit your preferences.

Set It as Your Browser’s Default Search Engine

SearXNG supports OpenSearch, which lets browsers recognize your instance as a search engine:

  • Firefox: Open your instance, right-click in the address bar, and select Add SearXNG. Then go to Settings > Search and select it as your default search engine.
  • Chrome, Edge, and other Chromium browsers: Open your instance and perform a search. You’ll then find SearXNG in the settings under Search engine > Manage search engines and site search, in the inactive shortcuts. From there, you can set it as the default.

According to the official documentation, Chromium browsers only add instances that you access without a path, directly from the domain, as in this guide. If a search engine named “SearXNG” already exists in your browser, you won’t be able to add another one. In that case, give your instance a custom name using instance_name.

Customize the Language and Search Services

Use Preferences in the top-right corner to choose the search language for your browser, set the SafeSearch filter level, and choose which search services SearXNG queries. SearXNG saves these settings as a cookie in your browser, so you’ll need to set them once on each device.

With a manual installation, you can set the defaults for all visitors in settings.yml. Disable individual search services like this:

Code
engines:
  - name: duckduckgo
    disabled: true

If you want to use only a few search services, replace the use_default_settings: true line with a list of the services you want:

Code
use_default_settings:
  engines:
    keep_only:
      - google
      - brave
      - wikipedia

Restart SearXNG after each change with docker compose restart core.

Search Directly with Shortcuts

Use an exclamation mark followed by a shortcut to search a specific service or category. !wp Berlin searches only Wikipedia, while !images sunset searches only for images. Use a colon to set the language, for example, :fr !wp Paris. You can find all shortcuts under Engines in Preferences.

Limitations

  • CAPTCHAs and blocks: Google, DuckDuckGo, and other search services recognize requests from server addresses and sometimes respond with a CAPTCHA or a block. SearXNG then temporarily disables the affected service—by default, for one day if there’s a CAPTCHA—and displays results from the other services. If your instance queries several search services, you’ll usually barely notice. In our test, DuckDuckGo showed a CAPTCHA right after installation, but searches still returned results from other services.
  • No guarantee for individual search services: If a search service changes its website, it often stops returning results in SearXNG until a new version fixes the issue. Make sure you keep SearXNG up to date.
  • Less convenience than Google: Personalized results, search history, and suggestions based on previous searches are intentionally not available.

Conclusion

You’ve set up SearXNG on your VPS, added it as your browser’s default search engine, and customized it to your preferences. From now on, you’ll search through your own server, without ads and without search services building a profile of you.

Prefer not to handle Docker yourself? Take the easy route with the One-Click App, as described above under “The Easy Way: SearXNG as a One-Click App.”

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

The One-Click App is the quickest option: SearXNG is available over HTTPS on your domain within minutes, Valkey for bot protection is included, and you can install updates in the dashboard. Manual installation with Docker Compose is a good choice if you want to edit settings.yml, protect your instance with reverse proxy authentication, or manage the version yourself.
No. SearXNG doesn’t have a login, so anyone who knows the address can search. To keep your instance private, add Basic Auth in the reverse proxy when using the manual installation. With the One-Click App, don’t share the access link, and enable bot protection by setting the SEARXNG_LIMITER environment variable to true.
Wikipedia, Wikidata, and OpenStreetMap require your instance to provide a contact address. For the One-Click App, add the custom environment variable SEARXNG_CONTACT_URL under App environment, for example, with the value mailto:you@example.com. For a manual installation, set contact_url in the general section of settings.yml.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.