AI Personal Learning
and practical guidance

Search APIs are too expensive, how do I build a free search engine myself?

Build your own private search engine SearXNG

Preparation. Make sure you have Docker and Docker Compose installed on your machine.


Step 1: Create the instance catalog

First, create a directory to hold the SearXNG configuration files:

mkdir searxng

Step 2: Run the SearXNG Docker Container

Use the following command to pull the Docker image of SearXNG and run the container:

docker run \ --rm -d -p 8081:8080 \ -v "${PWD}/searxng:/etc/searxng" \ -e "BASE_URL=http://localhost:8081/" \ -e "INSTANCE_NAME=searxng" \ searxng/searxng

Step 3: Enable JSON Format Output

SearXNG does not output results in JSON format by default.

  1. Go to the container's configuration file directory:cd /root/searxng
  2. Open it with your favorite text editor settings.yml Documentation.
  3. locate formats section, add json::
formats: - json # add json format
  1. Restart the Docker container to make the changes take effect:
docker restart

Step 4: Configure SearXNG in Open Web UI

Now you can add SearXNG as a custom search engine in Open Web UI.

  • Searxng query URL. http://:8081

commander-in-chief (military)  Replace with the IP address of the SearXNG instance.

  • Intranet access. Use the IP address of the container.
  • Extranet access. Use the public IP address of your server.

Done!

Note that the port can be replaced with the one you want to prevent whitelining.

May not be reproduced without permission:Chief AI Sharing Circle " Search APIs are too expensive, how do I build a free search engine myself?

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish