SearXNG
Last updated
Last updated
"Tools" has been fully upgraded to the "Plugins". For more details, please refer to . The content below has been archived.
SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled. Now you can use this tool directly in Dify.
Below are the steps for integrating SearXNG into Dify using Docker in the .
If you want to use SearXNG within the Dify cloud service, please refer to the to set up your own service, then return to Dify and fill in the service's Base URL in the "Tools > SearXNG > Authenticate" page.
The configuration file is located at dify/api/core/tools/provider/builtin/searxng/docker/settings.yml
, and you can refer to the config documentation .
Start the Docker container in the dify root directory.
Fill in the access address in "Tools > SearXNG > Authenticate" to establish a connection between the Dify service and the SearXNG service. The Docker internal address for SearXNG is usually http://host.docker.internal:8081
.
This section covers how to host SearXNG on a Linux VM and make it accessible to Dify.
Ensure your Linux VM has the following:
A fresh installation of a supported Linux distribution (e.g., Ubuntu 24.04 or any Debian-based distribution).
Docker and Docker Compose installed.
Follow these commands to install Docker:
Verify Docker installation:
Verify Docker Compose installation:
Clone the SearXNG repository into your desired directory on the Linux VM:
Edit the docker-compose.yaml
file to bind SearXNG to port 8081
and configure Redis. Ensure it looks like this:
Edit the settings.yml
configuration file to set the bind address and enable JSON format:
Once you’ve made the necessary changes, run the following command to start the containers:
By default, SearXNG in Docker will be bound to localhost
or 127.0.0.1
. To make it accessible externally (especially for Dify to connect), ensure the port 8081
is open on your Linux VM and that you’re using the appropriate public IP address.
You can check your VM's IP address with:
For the SearXNG service to be accessed from other machines or services (like Dify), you need to replace the Docker internal URL with your VM's public IP address.
Once your SearXNG instance is up and running on the Linux VM, you need to authenticate it in Dify.
Go to Tools > SearXNG > Authenticate in the Dify platform.
Enter the Base URL of your self-hosted SearXNG instance, using your VM’s IP address:
After entering the correct URL, save the configuration.
You can test if everything is working correctly by making a sample search using curl
:
You should receive a JSON response with search results for "apple".
By following these steps, you can successfully host a private instance of SearXNG on your Linux VM and integrate it with Dify. You’ll have your own self-hosted search engine, ensuring privacy and customization for your needs.