Hosting SearXNG has been the easiest one to setup thus far, it literally takes 5 minutes. It’s benefits are more than just privacy, let’s dive into it.

  • You can find my SearXNG instance here

About

SearXNG is a meta search engine, aggregates search results from various sources. No search engine today provides adequate results, everything is filled with ads and sites that just optimize for SEO & quantity over quality.

  • Most of today’s mainstream sites provide worse content than chat gpt 3.5.

What issues does SearXNG solve?

Finding Good Content & Finding it FAST! I don’t like wasting my time, unless it’s about configuring emacs, I just want to search for something and get the best results ASAP.

But Thanos, what do you mean? It’s a meta search engine, it’s not as fast as something like google or duckduckgo

Yes! Since SearXNG aggregates results from different sources, it’s not as fast as using a single one of them alone. But… let’s see a scenario that you want to search for a video, you’d open your browser, then go to youtube.com or odysee, then search for your video query. If you were using SearXNG all you’d have to do is just type !yt VIDEO-QUERY. Maybe you are looking for a book? just type !aa book-title on the saerch bar and you will get results from annas-archive.org

It’s even more powerful for researching ‘scientific’ topics. I can directly search pubmed for nano-antibiotics in treatment of lung infection by just writing !pub in front of the search query.

I’m using Nyxt as my browser, I had set different keybindings to search pubmed & the archlinux wiki but using a meta search engine like SearXNG is even more powerful than that & way easier to setup, offering ~70 search engines!.

How to setup SearXNG

  • I’m using Ionos to host my SearXNG instance, it offers unlimited bandwidth for just 1$/month, the best deal that I’ve found.
  • The best guide that I’ve found on setting up SearXNG is at landchad.net by goshawk22, refer to this guide & to the SearXNG docs if you have any issues.

Step 1: Clone the repo & run the installation script

$ git clone https://github.com/searxng/searxng /usr/local/searxng/searxng-src
$ cd /usr/local/searxng/searxng-src
$ ./utils/searxng.sh install all

Step 2: Configure nginx

Create a new file /etc/nginx/sites-available/searxng.conf and add the following:

server {
    # Listens on http
    listen 80;
    listen [::]:80;

    # Your server name
    server_name searx. example.org ;

    # If you want to log user activity, comment these
    access_log /dev/null;
    error_log  /dev/null;

    # X-Frame-Options (XFO) header set to DENY
    add_header X-Frame-Options "DENY";

    # HTTP Strict Transport Security (HSTS) header
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains";

    # Content Security Policy (CSP)
    add_header Content-Security-Policy "default-src 'self';";

    location / {
        uwsgi_pass unix:///usr/local/searxng/run/socket;

        include uwsgi_params;

        uwsgi_param    HTTP_HOST             $host;
        uwsgi_param    HTTP_CONNECTION       $http_connection;

        # see flaskfix.py
        uwsgi_param    HTTP_X_SCHEME         $scheme;
        uwsgi_param    HTTP_X_SCRIPT_NAME    /searxng;

        # see limiter.py
        uwsgi_param    HTTP_X_REAL_IP        $remote_addr;
        uwsgi_param    HTTP_X_FORWARDED_FOR  $proxy_add_x_forwarded_for;

    }
}
  • Create a symbolic link to enable this site.
$ ln -s /etc/nginx/sites-available/searxng.conf /etc/nginx/sites-enabled/searxng.conf
  • Now all you have to do is restart Nginx and SearXNG.
$ systemctl restart nginx
$ service uwsgi restart searxng
  • Setting up https connection with certbot optional
$ apt install python3-certbot-nginx # install certbot
$ certbot --nginx

Step 3: Configuring your instance

You will be playing around with those 2 paths:

/etc/searxng/settings.yml & /usr/local/searxng

You can find the default configuration here, although I recommend using the default settings as much as possible if you are just starting out.

Your theming configuration lies at usr/local/searxng/searxng-src/searx/static/themes/simple you can remove & edit the default logos or do whatever fancy stuff you like there.