After trialing SearXNG for a while, I decided to host my own SearXNG instance. In case you are not familiar with SearXNG, it's a metasearch engine that pulls search results from multiple sources, such as Google, Qwant, Brave Search, DuckDuckGo, etc. It does that while scrubbing off tracking, profiling, and other surveillance capitalism cruft.
Thanks to the Docker magic, deploying SearXNG is a fairly straightforward process. Assuming you don't have a Debian-based server or Virtual Private Server (VPS) ready, you need to do some preparatory work, though.
Before you can deploy SearXNG on your shiny new VPS, install Docker and clone SearXNG Git repository. To do this, log in to the VPS as root (or log in as a regular user and become root), and run the following commands:
apt update
apt upgrade
apt install apt-transport-https ca-certificates curl gnupg git fail2ban
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
cd /usr/local
git clone https://github.com/searxng/searxng-docker.git
cd searxng-docker
Use the nano .env
command to open the .env file for editing, and locate the following lines:
# SEARXNG_HOSTNAME=<host>
# LETSENCRYPT_EMAIL=<email>
Uncomment both lines and replace <host>
with the actual domain name and <email>
with a valid email address. The result should look as follows:
SEARXNG_HOSTNAME=domain.tld
LETSENCRYPT_EMAIL=me@domain.tld
Save the changes and close the file.
Generate a secret key:
sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml
And finally, start a SearXNG Docker container:
docker compose up -d
Point the browser to https://domain.tld (replace domain.tld with the domain name of the VPS), and you should see SearXNG in all its bare-bones beauty.
Source: searxng-docker