The Ultimate Private Search

I started my “degooglification” process some time last year, and while there are still things which I can’t fix yet (such as my dependence on at least one full Google-Android because of my Android Wear watch), I have come a long way since I started.

I’m doing a lot of self-hosting already, and I managed to replace most Google services with Nextcloud apps. The latest service I now completely made private is search. I had already been using startpage.com as my default search engine, which helps, but I was wondering if it’s possible to take it further. The answer to that is called Searx. It’s a metasearch engine, and even using a public instance is already pretty safe. If you want more privacy, you can host your own, installing it on your existing web server following these instructions. I did that, but I also just took it a step further, just to see if I can 😉

If you either don’t have your own server or want even more privacy, you can run it straight from your own computer, and if you then hide behind a private VPN server, nobody will ever be able to track your searches anymore 😉 . Ok, that last bit might be a little overkill. Let’s just assume you want to know how to do this because you don’t have your own server.

The following process was done on Ubuntu 18.04. It should work on any other Linux distribution, although the process of installing dependencies will differ if you’re not on a Debian based system. Note that only this first step will be done as the root user, everything else happens as your normal user.

  1. Install the dependencies, as per the official instructions:

    sudo apt-get install git build-essential libxslt-dev python-dev python-virtualenv python-babel zlib1g-dev libffi-dev libssl-dev

  2. Decide where you want to put the code. I put it in ~/bin.

    cd ~/bin
    git clone https://github.com/asciimoo/searx.git

  3. Create and activate the virtual environment:

    cd searx
    virtualenv searx-ve
    source searx-ve/bin/activate

  4. Install dependencies:

    ./manage.sh update_packages

  5. One final configuration step:

    sed -i -e "s/ultrasecretkey/`openssl rand -hex 16`/g" searx/settings.yml

  6. Now you can test it by running

    python searx/webapp.py

    and calling http://localhost:8888 from a web browser-

  7. Now, if you want to start it from your applications menu on whichever desktop environment you use, first create a shell script with the following content:

    #!/bin/bash
    cd /home//bin/searx
    source searx-ve/bin/activate
    python searx/webapp.py

    I called it start-searx and placed it in my ~/bin folder, which is where I put all my shell scripts.

  8. Now, you could either start this from a terminal or via Alt + F2. You can also use your DE’s menu editor, like Alacarte in GNOME to create an entry you can click on, or add it to your autostart.

Voilà, your perfectly local search engine.

All credit for the installation instructions goes to the developer; I only added the local bits and removed the parts related to a production server accessible from the Internet.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Feel free to use a pseudonym.