sidebar_position: 16
:::warning This tutorial is a community contribution and is not supported by the OpenWebUI team. It serves only as a demonstration on how to customize OpenWebUI for your specific use case. Want to contribute? Check out the contributing tutorial. :::
Open WebUI allows you to integrate directly into your web browser. This tutorial will guide you through the process of setting up Open WebUI as a custom search engine, enabling you to execute queries easily from your browser's address bar.
Before you begin, ensure that:
WEBUI_URL environment variable is set correctly, either using Docker environment variables or in the .env file as specified in the Getting Started guide.Setting the WEBUI_URL environment variable ensures your browser knows where to direct queries.
If you are running Open WebUI using Docker, you can set the environment variable in your docker run command:
docker run -d \
-p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
-e WEBUI_URL="https://<your-open-webui-url>" \
ghcr.io/open-webui/open-webui:main
Alternatively, you can add the variable to your .env file:
WEBUI_URL=https://<your-open-webui-url>
Fill in the details as follows:
URL with %s in place of query:
https://<your-open-webui-url>/?q=%s
Click Add to save the configuration.
Alternatively:
If you wish to utilize a specific model for your search, modify the URL format to include the model ID:
https://<your-open-webui-url>/?models=<model_id>&q=%s
Note: The model ID will need to be URL-encoded. Special characters like spaces or slashes need to be encoded (e.g., my model becomes my%20model).
Once the search engine is set up, you can perform searches directly from the address bar. Simply type your chosen keyword followed by your query:
webui your search query
This command will redirect you to the Open WebUI interface with your search results.
If you encounter any issues, check the following:
WEBUI_URL is correctly configured and points to a valid Open WebUI instance.