Installation guide
SearXNG is a free internet metasearch engine which aggregates results from more than 70 search services. Users are neither tracked nor profiled. Additionally, SearXNG can be used over Tor for online anonymity.- https://docs.searxng.org/
This guide will show you how to setup a SearXNG instance to be used with Khofly Search as it's front-end, your instance will still be perfectly usable on it's own. Important differences:
Khofly utilizes SearXNG /search API to get the results as JSON so we will need to enable - json as output format in settings.yml.
Since Khofly Search and SearXNG instance are on different domains we will need to add Access-Control-Allow-Origin header in Nginx config to avoid CORS error
Requirements:
A fully qualified domain name (FQDN)
Virtual Private Server (VPS) that you are renting
If you're the only person using your SearXNG instance a basic 5$ VPS will do just fine
Make sure everything is up to date
Create a new user
Doing this allows you to isolate all the commands and files when installing and configuring SearXNG. It can be especially useful if you intend to host the search engine on a VPS with multiple services.
Install dependencies
Clone and install SearXNG
There are three different methods for installing SearXNG ( manual, installation script, docker ), all explained at the official wiki. Here we will use the installation script which automates the manual process. First we need to clone the SearXNG repository. After that is finished, run the installation script.
Installation process is mostly automatic, but you will be asked to confirm everything that SearXNG wants to install.
Nginx configuration
On Arch check if sites-available and sites-enable directories exist, if not create them (mkdir sites-available sites-enabled
) and create the default file inside of /sites-available (touch default
)
If your server is behind a Cloudflare proxy you need to adjust X-Real-IP and X-Forwarded-For like this
SearXNG configuration
Default configuration file for SearXNG is located at /etc/searxng/settings.yml ( read more about the different options at the official wiki ), this is an example config and you will want to change the following values:
general.instance_name - to whatever you want ( optional ) search.suspended_times.SearxEngineAccessDenied - 240 is ok, default is way too high ( optional ) search.formats - make sure the json format is enabled along with html if you want to use your instacne as a front-end as well server.secret - make sure to change to a random key ( ex. runopenssl rand -hex 32
)
Finalize installation
Maintenance
How to update
Read more