Step by step installation

In this section we show the setup of a SearXNG instance that will be installed by the Installation Script.

Install packages

$ sudo -H apt-get install -y \
    python3-dev python3-babel python3-venv \
    uwsgi uwsgi-plugin-python3 \
    git build-essential libxslt-dev zlib1g-dev libffi-dev libssl-dev


This installs also the packages needed by uWSGI

Create user

$ sudo -H useradd --shell /bin/bash --system \
    --home-dir "/usr/local/searxng" \
    --comment 'Privacy-respecting metasearch engine' \

$ sudo -H mkdir "/usr/local/searxng"
$ sudo -H chown -R "searxng:searxng" "/usr/local/searxng"

Install SearXNG & dependencies

Start a interactive shell from new created user and clone SearXNG:

$ sudo -H -u searxng -i
(searxng)$ git clone "" \

In the same shell create virtualenv:

(searxng)$ python3 -m venv "/usr/local/searxng/searx-pyenv"
(searxng)$ echo ". /usr/local/searxng/searx-pyenv/bin/activate" \
                   >>  "/usr/local/searxng/.profile"

To install SearXNG’s dependencies, exit the SearXNG bash session you opened above and start a new one. Before installing, check if your virtualenv was sourced from the login (~/.profile):

$ sudo -H -u searxng -i

(searxng)$ command -v python && python --version
Python 3.8.1

# update pip's boilerplate ..
pip install -U pip
pip install -U setuptools
pip install -U wheel
pip install -U pyyaml

# jump to SearXNG's working tree and install SearXNG into virtualenv
(searxng)$ cd "/usr/local/searxng/searxng-src"
(searxng)$ pip install -e .


Open a second terminal for the configuration tasks and leave the (searx)$ terminal open for the tasks below.


To create a initial /etc/searxng/settings.yml we recommend to start with a copy of the file git://utils/templates/etc/searxng/settings.yml. This setup use default settings from git://searx/settings.yml and is shown in the tab “Use default settings” below. This setup:

Modify the /etc/searxng/settings.yml to your needs:

# SearXNG settings

use_default_settings: true

  debug: false
  instance_name: "SearXNG"

  safe_search: 2
  autocomplete: 'duckduckgo'

  # Is overwritten by ${SEARXNG_SECRET}
  secret_key: "ultrasecretkey"
  limiter: true
  image_proxy: true
  # public URL of the instance, to ensure correct inbound links. Is overwritten
  # by ${SEARXNG_URL}.
  # base_url:

  # URL to connect redis database. Is overwritten by ${SEARXNG_REDIS_URL}.
  url: unix:///usr/local/searxng-redis/run/redis.sock?db=0

  static_use_hash: true

# preferences:
#   lock:
#     - autocomplete
#     - method

  - 'Hash plugin'
  - 'Self Informations'
  - 'Tracker URL remover'
  - 'Ahmia blacklist'
  # - 'Hostname replace'  # see hostname_replace configuration below
  # - 'Open Access DOI rewrite'

# plugins:
#   - only_show_green_results

To see the entire file jump to git://utils/templates/etc/searxng/settings.yml

For a minimal setup you need to set server:secret_key.

$ sudo -H mkdir -p "/etc/searxng"
$ sudo -H cp "/usr/local/searxng/searxng-src/utils/templates/etc/searxng/settings.yml" \


To check your SearXNG setup, optional enable debugging and start the webapp. SearXNG looks at the exported environment $SEARXNG_SETTINGS_PATH for a configuration file.

# enable debug ..
$ sudo -H sed -i -e "s/debug : False/debug : True/g" "/etc/searxng/settings.yml"

# start webapp
$ sudo -H -u searxng -i
(searxng)$ cd /usr/local/searxng/searxng-src
(searxng)$ export SEARXNG_SETTINGS_PATH="/etc/searxng/settings.yml"
(searxng)$ python searx/

# disable debug
$ sudo -H sed -i -e "s/debug : True/debug : False/g" "/etc/searxng/settings.yml"

Open WEB browser and visit . If you are inside a container or in a script, test with curl:

$ xdg-open

If everything works fine, hit [CTRL-C] to stop the webapp and disable the debug option in settings.yml. You can now exit SearXNG user bash session (enter exit command twice). At this point SearXNG is not demonized; uwsgi allows this.