
How to Host your own Search Engine with Docker
If you don’t want to use a search engine that is hosted by a big company like Google or Microsoft, you can host your own search engine with SearXNG. SearXNG is a meta-search engine that aggregates results from different search engines. This is better in terms of privacy compared to using those search engines directly.
I use SearXNG just locally on my machine, but you can of course host this yourself. In fact, you can also use a publicly hosted instance of SearXNG. This tutorial is limited to just a simple localhost instance of SearXNG.
To get started with hosting a local instance of SearXNG, you will need Docker installed on your machine.
In some cases your SearXNG instance might be blocked by an engine after having received too many requests from your server.
Setup
- Create the enviroment:
# Create the environment and configuration directories
mkdir -p ./searxng/core-config/
cd ./searxng/
# Fetch the latest compose template
curl -fsSL \
-O https://raw.githubusercontent.com/searxng/searxng/master/container/docker-compose.yml \
-O https://raw.githubusercontent.com/searxng/searxng/master/container/.env.example
- Copy the .env.example file and edit the values as needed:
cp -i .env.example .env
vim .env
- Start the services:
docker compose up -d
- You can open SearXNG by navigating to
localhost:8080(or whatever port you have configured):
