323
In an attempt to de-google my life, I am running a local instance of SearXNG, a search front end that uses multiple search engines, anonymizes requests, and blocks ads and AI drivel. It works really, really well.
I wanted to make it my default search engine in Firefox, and that proved to be a bit challenging. I want to document here what I did; it might be useful not only for this but for other tweaks to your search engines. Follow these steps.
- Install the “local” SearXNG extension that’s available for Firefox. Go to Settings/Search, then click “Find More Search Engines” and search for “SearXNG”. You’ll find several listings. The one I started with (in February, 2025) is called “Private – SearXNG”. Install that.
- Exit Firefox and open a console window, navigating to your profile directory (on Linux, in ~/.mozilla/firefox/<something>.default-release).
- There’s a file called “search.json.mozlz4”. Make a backup copy.
- Then run this command:
python3 -c "import lz4.block; open('search.json', 'wb').write(lz4.block.decompress(open('search.json.mozlz4', 'rb').read()[8:]))"
- That will decompress the search configuration file. Now run:
python3 -m json.tool search.json > search_pretty.json
- That will yield a nicely formatted version of the JSON file. Find the line(s) with the SearXNG URL and edit it to suit your needs, and save the file.
- Now run these commands to recompress the file:
python3 -c "import json, sys; json.dump(json.load(open('search_pretty.json')), open('search.json', 'w'))"
python3 -c "import lz4.block; open('search.json.mozlz4', 'wb').write(b'mozLz40\0' + lz4.block.compress(open('search.json', 'rb').read()))"
- Now when you restart Firefox, you should have SearXNG available with your customized URL.
This procedure should allow you to modify any Firefox search engine entry. I’ve only used if for SearXNG, though.