Skip to content

First Run

Scope: from an installed tree to a searching server — the settings file, the one value you must change before anything else, starting it, and the first search, including the lab's instructive failure.

Your own settings file

Never edit the stock file inside the clone; copy it somewhere of yours and point the server at the copy:

mkdir ~/searxng-settings
cp searx/settings.yml ~/searxng-settings/settings.yml

The server finds it through an environment variable, SEARXNG_SETTINGS_PATH. Everything the admin controls flows through this one file.

The one required edit: the secret key

The stock file ships with a placeholder:

server:
  secret_key: "ultrasecretkey"

That value is printed in a public repository; anyone on earth knows it. It signs the instance's internal tokens, and leaving it in place on an instance anyone else can reach is the classic SearXNG mistake. Replace it with a long random value of your own:

openssl rand -hex 32

and paste the result over the placeholder. The lab did this before its server was ever started (transcript t00), and examples/settings-extract.yml shows the line as it should look, value withheld.

Two stock defaults are worth knowing rather than changing: server.port: 8888 and server.bind_address: "127.0.0.1" — the instance answers only on its own machine until you deliberately widen it (chapter 10 talks about that decision).

Starting it

SEARXNG_SETTINGS_PATH=~/searxng-settings/settings.yml \
  ./venv/bin/python -m searx.webapp
* Serving Flask app 'webapp'
* Debug mode: off

That is Python's built-in development server — perfectly serviceable for one household on one machine, and what the lab used throughout. A public instance wants a production server in front; that is chapter 10's territory, not a first-run concern.

Check:

curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8888/
# 200, and the page's title is "SearXNG"
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:8888/preferences
# 200

(Transcript t01 holds the lab's copies.)

The first search — and the lab's empty page

Search for something ordinary. The lab's first try came back with a polite "No results were found," and the server log filled with engine timeouts (transcript t02). The cause was the build machine's odd network — its only internet path is a proxy that SearXNG, which does not read the shell's proxy variables, knew nothing about — and the fix was two settings (outgoing.proxies, and enable_http2: false when the proxy proved to reset HTTP/2). A home machine on an ordinary connection should never meet either problem. The episode earned its place in this guide anyway, for the diagnostic habit it teaches:

When every engine fails at once, suspect the network path, not the engines. The log names each engine's error separately precisely so you can see the pattern.

With that fixed, the same search returned ten proper results (transcript t03) — and, just as instructive, the log still showed two engines rate-limited and one timed out. A working SearXNG is not one where every engine answers; it is one where enough do, and the rest are named. Chapter 5 is about searching well inside that reality.