Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

SearXNG/Installation

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

There are multiple ways to install SearXNG. Docker This is the recommended method, as it is the easiest. First, create a directory for the instance and enter it:mkdir my-instance cd my-instance/Next, specify a port for the container to run on. 8080 is used for this example:export PORT=8080Then, pull the container from the repository:docker pull searxng/searxngNow, run the container. Replace "my-instance" with whatever you want to call your instance:docker run --rm \ -d -p ${PORT}:8080 \ -v "${PWD}/searxng:/etc/searxng" \ -e "BASE_URL=http://localhost:$PORT/" \ -e "INSTANCE_NAME=my-instance" \ searxng/searxngIf your web browser is running on the same computer that you installed SearXNG on, go to "localhost:8080" in your web browser. If not, enter the IP address of the computer SearXNG was installed on, and specify port 8080 (or whichever port you chose). If you installed it correctly, you should get the SearXNG homepage. Installation script The installation script is also fairly easy to do, though depending on your server it may have more issues than Docker. First, clone the repository and enter its directory:git clone https://github.com/searxng/searxng.git searxng cd searxngThen, run the script as root. Replace "sudo" with whichever privilege elevation program you use:sudo -H ./utils/searxng.sh install all Manual step-by-step installation This method is intended for advanced users and is not necessary in most cases. First, install the necessary packages: On Debian-based systems:sudo apt install python3-dev python3-babel python3-venv uwsgi uwsgi-plugin-python3 git build-essential libxslt-dev zlib1g-dev libffi-dev libssl-devOn Arch-based systems:sudo pacman -S python python-pip python-lxml python-babel uwsgi uwsgi-plugin-python git base-devel libxml2On Fedora/RHEL systems:sudo dnf install python python-pip python-lxml python-babel python3-devel uwsgi uwsgi-plugin-python3 git @development-tools libxml2 opensslNext, create the searxng user:sudo useradd --shell /bin/bash --system --home-dir "/usr/local/searxng" --comment 'Privacy-respecting metasearch engine' searxngCreate the searxng user's home directory, and give the directory the correct permissions:sudo mkdir /usr/local/searxng sudo chown -R searxng:searxng /usr/local/searxngNext, change to the searxng user:su - searxngAlternatively, use the interactive mode of sudo:sudo -u searxng -iAs the searxng user, create virtualenv:python3 -m venv "/usr/local/searxng/searx-pyenv" echo ". /usr/local/searxng/searx-pyenv/bin/activate" >> "/usr/local/searxng/.profile"Exit the session and start a new one. Then, use pip to install the necessary dependencies:command -v python && python --version pip install -U pip pip install -U setuptools pip install -U wheel pip install -U pyyaml cd /usr/local/searxng/searxng-src pip install -e .Next, create a file called "settings.yml" and copy this configuration into it. Modify it to your preferences. After that, copy the configuration file to the correct directory:sudo mkdir -p /etc/searxng sudo cp /usr/local/searxng/searxng-src/utils/templates/etc/searxng/settings.yml /etc/searxng/settings.ymlEnable debugging and start the web app:sudo sed -i -e "s/debug : False/debug : True/g" /etc/searxng/settings.yml sudo -u searxng -i cd /usr/local/searxng/searxng-src export SEARXNG_SETTINGS_PATH="/etc/searxng/settings.yml" python searx/webapp.pyIf you ever want to disable debugging, use the following command:sudo sed -i -e "s/debug : True/debug : False/g" /etc/searxng/settings.ymlIf you did this correctly, SearXNG should be running on port 8888. Category:Book:SearXNG