How I Created my own Search Engine with SearXNG
Table of Contents
Why do this?
Many search engines (pretty much all of them) collect your data to serve ads based on your searches. Even DuckDuckGo, the “privacy first” search engine has exclusive deals with Microsoft. You can see this when you visit Microsoft services (e.g. LinkedIn) in the DuckDuckGo mobile browser and check the blocked cookies. No Microsoft or LinkedIn domains appear in the list.
Preparing your Server
Step 1: Get the Server
You can use any Linux computer (e.g. a Raspberry Pi) to run your search engine. Make sure it has a stable internet connection and can be online most of the time. I use a DigitalOcean VPS to run my server in the cloud, but you can also use Vultr. Using my links can get you free $100 credit when you sign up!
Step 2: Install Docker and Docker-Compose
The way you install Docker and Docker-Compose depends on your distro. Here are the steps for common distros:
Debian/Ubuntu/Raspberry Pi OS (Raspbian):
sudo apt-get update && sudo apt-get install docker.io docker-compose
Fedora/RHEL/CentOS/Rocky Linux:
sudo yum -y install dnf-plugins-core
sudo yum config-manager \
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Arch Linux/Manjaro:
yay -S docker docker-compose
Gentoo Linux:
sudo emerge -q app-containers/docker app-containers/docker-compose
Download and Install SearXNG
- Create the key using this command:
sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml
- Start the Docker containers using this command: docker-compose up -d
SearXNG should be started now. You can point any domain(s) you have to the IP address of your server, or you can just use the IP address of your server to test your new search engine!
If you get an error about “too many redirects,” edit the searxng/settings.yml file and add method: "GET" under server:.