SearXNG Local Deployment and Configuration
CherryStudio supports web search via SearXNG. SearXNG is an open-source project that can be deployed locally or on a server, so its configuration differs slightly from other setups that require an API provider.
SearXNG project link:SearXNG
Advantages of SearXNG
Open-source and free, no API required
Relatively strong privacy
Highly customizable
Local deployment
1. Direct Docker deployment
Because SearXNG does not require complex environment configuration, you do not need docker compose. You only need to provide an idle port to deploy it, so the fastest way is to deploy it directly with Docker by pulling the image.
1. Download, install, and configure docker

After installation, choose an image storage path:

2. Search for and pull the SearXNG image
Enter in the search bar searxng :

Pull the image:


3. Run the image
After the pull succeeds, go to the images page:

Select the pulled image and click Run:

Open the settings to configure:

Take 8085 port as an example:

After it runs successfully, click the link to open the SearXNG frontend interface:

If this page appears, deployment was successful:

Server deployment
Given that installing Docker on Windows is rather troublesome, users can deploy SearXNG on a server and share it with others. Unfortunately, SearXNG itself does not currently support authentication, so others may be able to discover and abuse your deployed instance through technical means.
For this reason, Cherry Studio now supports configuring HTTP Basic Authentication (RFC7617). If you want to expose your deployed SearXNG to the public internet, pleasemake sureto configure HTTP Basic Authentication through a reverse proxy such as Nginx. A brief tutorial is provided below; basic Linux operations knowledge is required.
Deploy SearXNG
Similarly, Docker is still used for deployment. Assuming you have already followed theofficial tutorialto install the latest version of Docker CE on your server, the following one-stop command applies to a fresh installation on a Debian system:
If you need to change the local listening port or reuse an existing local nginx, you can edit the docker-compose.yaml file, refer to the following:
Run docker compose up -d to start. Run docker compose logs -f searxng to view the logs.
Deploy Nginx reverse proxy and HTTP Basic Authentication
If you use a server control panel application, such as BaoTa Panel or 1Panel, please refer to its documentation to add a website and configure an Nginx reverse proxy. Then find where you can edit the Nginx configuration file and modify it according to the example below:
Assuming the Nginx configuration file is saved under /etc/nginx/conf.d we will save the password file in the same directory.
Run the command (replace example_name,example_password with the username and password you want to set):
Restart Nginx (reloading the configuration is also fine).
At this point, open the webpage and you should be prompted to enter a username and password. Enter the username and password you set earlier to see whether you can successfully enter the SearXNG search page and use this to check whether the configuration is correct.

Cherry Studio related configuration
After SearXNG has been successfully deployed locally or on a server, the next step is the CherryStudio-related configuration.
Go to the web search settings page and select Searxng:

If you directly enter the locally deployed link and find that verification fails, don't worry:

Because after direct deployment, the JSON return type is not configured by default, so data cannot be obtained and the configuration file needs to be modified.
Go back to Docker, go to the Files tab, and find the tagged folder in the image:

After expanding it, continue scrolling down and you will find another tagged folder:

Continue expanding and find the settings.yml configuration file:

Click to open the file editor:

Find line 78, where you can see that the only type is html

Add the json type, save it, and run the image again


Go back to Cherry Studio to verify again; verification succeeds:

The address can be entered as local: http://localhost : port number or as the Docker address:http://host.docker.internal : port number
If the user followed the previous example to deploy on a server and configured the reverse proxy correctly, JSON return type has already been enabled. After entering the address and verifying, because HTTP Basic Authentication has been configured for the reverse proxy, the verification should return error code 401:

Configure HTTP Basic Authentication on the client side and enter the username and password you just set:

Verify, and it should succeed.
Other configurations
At this point, SearXNG already has the default ability to search the web. If you need to customize the search engines, you need to configure them yourself
Note that the preferences here do not affect the configuration used when calling the large model

If you need to configure the search engines used for large model calls, set it in the configuration file:


Refer to the configuration language:

If the content is too long and inconvenient to edit directly, you can copy it to a local IDE, make changes, and then paste it back into the configuration file.
Common causes of verification failure
The return format does not include JSON
Add json to the return formats in the configuration file:

Search engine not configured correctly
Cherry Studio will by default choose engines whose categories include both web and general for search. By default it will select engines such as Google, which fail because mainland China cannot access sites like Google directly. Adding the following configuration forces searxng to use the baidu engine, which solves the problem:
Access rate too fast
The limiter configuration in searxng blocks API access. Try setting it to false in the settings:

Last updated
Was this helpful?