### Frontend Setup and Development Server Source: https://github.com/open-webui/docs/blob/main/docs/getting-started/advanced-topics/development.md Set up the frontend environment by copying the example environment file, installing dependencies, building the frontend, and starting the development server. The development server will run at http://localhost:5173. ```bash cp -RPp .env.example .env npm install npm run build npm run dev ``` -------------------------------- ### Install and Serve Open WebUI with pip Source: https://github.com/open-webui/docs/blob/main/docs/features/index.mdx Install Open WebUI using pip and start the server. This is a quick way to get started on a single machine. ```bash pip install open-webui && open-webui serve ``` -------------------------------- ### Quick Setup for LiteLLM Proxy Source: https://github.com/open-webui/docs/blob/main/docs/getting-started/quick-start/connect-a-provider/starting-with-openai-compatible.mdx Install LiteLLM and start the proxy server. This allows Open WebUI to connect to various LLM providers through a unified OpenAI-compatible API. ```bash pip install litellm litellm --model gpt-4 --port 4000 ``` -------------------------------- ### Start Open WebUI Local Install Source: https://github.com/open-webui/docs/blob/main/docs/troubleshooting/manual-database-migration.md Start the Open WebUI application for a local installation and monitor logs for successful startup. Access the application via a web browser. ```bash # Start Open WebUI python -m open_webui.main # Watch for successful startup messages # Test by navigating to http://localhost:8080 ``` -------------------------------- ### Install and Run Open WebUI Frontend Locally Source: https://github.com/open-webui/docs/blob/main/docs/features/chat-conversations/audio/text-to-speech/chatterbox-tts-api-integration.md Navigate to the frontend directory, install dependencies, and start the development server for local development. ```bash cd frontend && npm install && npm run dev ``` -------------------------------- ### Backend Setup and Development Server Source: https://github.com/open-webui/docs/blob/main/docs/getting-started/advanced-topics/development.md Navigate to the backend directory, set up a Python virtual environment (using Conda or venv), install backend dependencies, and start the development server. The backend will run at http://localhost:8080. ```bash cd backend # Option A: Conda conda create --name open-webui python=3.11 conda activate open-webui # Option B: venv python3 -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate pip install -r requirements.txt -U sh dev.sh ``` -------------------------------- ### Install and Run cptr Source: https://github.com/open-webui/docs/blob/main/docs/getting-started/quick-start/connect-an-agent/cptr.mdx Install cptr using pip and start the service. Alternatively, use uvx for installation and execution. ```bash pip install cptr cptr run ``` ```bash uvx cptr@latest run ``` -------------------------------- ### Full Continue.dev configuration for Open WebUI Source: https://github.com/open-webui/docs/blob/main/docs/tutorials/integrations/dev-tools/continue-dev.md A complete example configuration for using Llama3 with a local Open WebUI setup. ```yaml name: Local Assistant version: 1.0.0 schema: v1 models: - name: LLama3 provider: openai model: Meta-Llama-3-8B-Instruct-Q4_K_M.gguf env: useLegacyCompletionsEndpoint: false apiBase: http://localhost:3000/api apiKey: YOUR_OPEN_WEBUI_API_KEY roles: - chat - edit context: - provider: code - provider: docs - provider: diff - provider: terminal - provider: problems - provider: folder - provider: codebase ``` -------------------------------- ### Quick Start: MCP-to-OpenAPI Bridge Source: https://github.com/open-webui/docs/blob/main/docs/features/extensibility/plugin/tools/openapi-servers/faq.mdx Use this command to quickly set up the MCP-to-OpenAPI Bridge, exposing an MCP server as an OpenAPI-compatible API. Ensure `uvx` is installed and configured. ```bash uvx mcpo --port 8000 -- uvx mcp-server-time --local-timezone=America/New_York ``` -------------------------------- ### Dockerfile for Pre-installing Python Packages Source: https://github.com/open-webui/docs/blob/main/docs/features/extensibility/plugin/tools/development.mdx Example Dockerfile demonstrating how to pre-install Python packages during the image build process. This is recommended for production environments to avoid runtime installation issues. ```dockerfile FROM ghcr.io/open-webui/open-webui:main RUN pip install --no-cache-dir python-docx requests beautifulsoup4 ``` -------------------------------- ### Install Open WebUI with Docker Source: https://github.com/open-webui/docs/blob/main/docs/intro.mdx Run Open WebUI using Docker. This command starts a container, maps port 3000, and sets up persistent storage. Access it at http://localhost:3000. ```bash docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main ``` -------------------------------- ### Alternative Server Start Command Source: https://github.com/open-webui/docs/blob/main/docs/getting-started/quick-start/tab-python/Pip.md If 'open-webui: command not found' error occurs, try running the serve command directly using python -m. This is useful if the package is installed in a virtual environment. ```bash python -m open_webui serve ``` -------------------------------- ### Start Open WebUI Server Source: https://github.com/open-webui/docs/blob/main/docs/getting-started/quick-start/tab-python/Venv.md Starts the Open WebUI server. This command assumes Open WebUI has been installed and the virtual environment is active. It may require specifying a data directory for persistent storage. ```bash open-webui serve ``` ```bash DATA_DIR=./data open-webui serve ``` ```bash python -m open_webui serve ``` -------------------------------- ### Install Open WebUI with uv Source: https://github.com/open-webui/docs/blob/main/docs/intro.mdx Install and serve Open WebUI using uv, a fast Python package installer. This method uses a curl script for uv installation and then serves Open WebUI. Access it at http://localhost:8080. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh DATA_DIR=~/.open-webui uvx --python 3.11 open-webui@latest serve ``` -------------------------------- ### Install Tailscale on Linux Source: https://github.com/open-webui/docs/blob/main/docs/reference/https/tailscale.md Use the official installation script to set up Tailscale on Linux distributions. ```bash curl -fsSL https://tailscale.com/install.sh | sh ``` -------------------------------- ### Install mcpo with uvx Source: https://github.com/open-webui/docs/blob/main/docs/features/extensibility/plugin/tools/openapi-servers/mcp.mdx Install the mcpo tool using uvx for faster startup. This command installs mcpo and prepares it to run your MCP server command. ```bash uvx mcpo --port 8000 -- your_mcp_server_command ``` -------------------------------- ### Direct Open Terminal Connection Configuration Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Example of configuring a direct connection to an Open Terminal instance. This setup is used when Open WebUI needs to connect to a standalone Open Terminal server. ```json [ { "id": "unique-id", "url": "http://open-terminal:8000", "key": "your-api-key", "name": "Dev Terminal", "auth_type": "bearer", "config": { "access_grants": [] } } ] ``` -------------------------------- ### Install Open WebUI Frontend with Force Flag Source: https://github.com/open-webui/docs/blob/main/docs/features/chat-conversations/audio/text-to-speech/chatterbox-tts-api-integration.md Use this command if you encounter dependency issues during `npm install` for the frontend. It forces the installation of dependencies. ```bash npm install --force ``` -------------------------------- ### Install Docker on Ubuntu Source: https://github.com/open-webui/docs/blob/main/docs/reference/https/caddy.md Command to install Docker and related plugins on an Ubuntu system. ```bash sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose ``` -------------------------------- ### Install and run Chatterbox TTS with pip Source: https://github.com/open-webui/docs/blob/main/docs/features/chat-conversations/audio/text-to-speech/chatterbox-tts-api-integration.md Traditional installation method using Python virtual environments and pip. ```bash # Clone the repository git clone https://github.com/travisvn/chatterbox-tts-api cd chatterbox-tts-api # Setup environment — using Python 3.11 python -m venv .venv source .venv/bin/activate # Install dependencies pip install -r requirements.txt # Copy and customize environment variables cp .env.example .env # Add your voice sample (or use the provided one) # cp your-voice.mp3 voice-sample.mp3 # Start the API with FastAPI uvicorn app.main:app --host 0.0.0.0 --port 4123 # Or use the main script python main.py ``` -------------------------------- ### Install ngrok on Linux Source: https://github.com/open-webui/docs/blob/main/docs/reference/https/ngrok.md Download and install ngrok on Linux by extracting the archive to /usr/local/bin. ```bash curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok-v3-stable-linux-amd64.tgz \ | sudo tar xz -C /usr/local/bin ``` -------------------------------- ### Install PostgreSQL Dependencies for PGVector Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx To use the PGVector database, you need to install the necessary dependencies. This command installs all required packages for Open WebUI, including those for PGVector. ```bash pip install open-webui[all] ``` -------------------------------- ### Install MariaDB Connector Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Install the MariaDB connector for Open WebUI. This is required for MariaDB Vector functionality. ```bash pip install open-webui[mariadb] ``` -------------------------------- ### MariaDB Vector Database URL Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Example of the database URL for MariaDB Vector storage. It must use the 'mariadb+mariadbconnector://' scheme. ```text mariadb+mariadbconnector://user:password@localhost:3306/openwebui ``` -------------------------------- ### Request Example for OAuth Token Exchange Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx This example shows how to make a POST request to the OAuth token exchange endpoint to obtain an Open WebUI JWT session token. ```bash curl -X POST "http://localhost:8080/api/v1/oauth/google/token/exchange" \ -H "Content-Type: application/json" \ -d '{"token": "ya29.a0AfH6SMB...'} ``` -------------------------------- ### Example API Keys Allowed Endpoints Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx An example of a comma-separated list of allowed API endpoints when API key endpoint restrictions are enabled. ```text /api/v1/messages,/api/v1/channels,/api/v1/chat/completions ``` -------------------------------- ### Redis URL Examples Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Specify the URL for your Redis instance or cluster. Supports basic, password-protected, and mTLS configurations. ```bash redis://localhost:6379/0 ``` ```bash rediss://:password@localhost:6379/0 ``` ```bash rediss://redis-cluster.redis.svc.cluster.local:6379/0?ssl_cert_reqs=required&ssl_certfile=/tls/redis/tls.crt&ssl_keyfile=/tls/redis/tls.key&ssl_ca_certs=/tls/redis/ca.crt ``` -------------------------------- ### Configure ChromaDB HTTP Headers Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx This example shows how to set HTTP headers for ChromaDB requests, useful for authentication or custom configurations. Ensure headers are comma-separated. ```bash export CHROMA_HTTP_HEADERS="Authorization=Bearer heuhagfuahefj,User-Agent=OpenWebUI" ``` -------------------------------- ### Custom API Key Header Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Demonstrates how to use a custom header for API key authentication when behind a proxy that consumes the default Authorization header. ```bash curl -H "X-OpenWebUI-Key: sk-..." http://openwebui.internal/api/models ``` -------------------------------- ### Configure ChromaDB Authentication Provider Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Specify an authentication provider for connecting to a remote ChromaDB server. This example uses basic authentication. ```bash export CHROMA_CLIENT_AUTH_PROVIDER="chromadb.auth.basic_authn.BasicAuthClientProvider" ``` -------------------------------- ### WEBSOCKET_SERVER_LOGGING Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Enable verbose logging for SocketIO server related to websocket operations. Recommended only for debugging Redis issues. ```bash WEBSOCKET_SERVER_LOGGING=true ``` -------------------------------- ### Install and Build Open WebUI Frontend for Production Source: https://github.com/open-webui/docs/blob/main/docs/features/chat-conversations/audio/text-to-speech/chatterbox-tts-api-integration.md Navigate to the frontend directory, install dependencies, and build the project for production deployment. ```bash cd frontend && npm install && npm run build ``` -------------------------------- ### WEBSOCKET_REDIS_OPTIONS Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Configure advanced Redis connection options for the websocket client using a JSON string. Ensure double quotes are escaped when using AWS SSM or Docker Compose. ```bash WEBSOCKET_REDIS_OPTIONS='{"retry_on_timeout": true, "socket_connect_timeout": 5, "socket_timeout": 5, "max_connections": 8}' ``` -------------------------------- ### WEBSOCKET_SERVER_ENGINEIO_LOGGING Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Enable verbose logging for Engine.IO server related to websocket operations. Inherits WEBSOCKET_SERVER_LOGGING if not set. Recommended only for debugging Redis issues. ```bash WEBSOCKET_SERVER_ENGINEIO_LOGGING=true ``` -------------------------------- ### WEBSOCKET_SERVER_PING_INTERVAL Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Set the interval in seconds for sending heartbeat pings to websocket clients. ```bash WEBSOCKET_SERVER_PING_INTERVAL=20 ``` -------------------------------- ### CLI Reference: Initialize Configuration Source: https://github.com/open-webui/docs/blob/main/docs/features/knowledge-base-sync/index.md Launches an interactive wizard to help create a `.oikb.yaml` configuration file. ```bash oikb init ``` -------------------------------- ### WEBSOCKET_SERVER_PING_TIMEOUT Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Set the timeout in seconds for the websocket server to wait for a client pong. Increase for slow networks or brief tab pauses. ```bash WEBSOCKET_SERVER_PING_TIMEOUT=30 ``` -------------------------------- ### ENABLE_STAR_SESSIONS_MIDDLEWARE Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Enable experimental Redis-based session storage for OAuth flows using StarSessions middleware. This helps resolve CSRF errors in multi-replica deployments but has known limitations with Redis Sentinel/Cluster. ```bash ENABLE_STAR_SESSIONS_MIDDLEWARE=true ``` -------------------------------- ### Launch Time Tool Server Locally Source: https://github.com/open-webui/docs/blob/main/docs/features/extensibility/plugin/tools/openapi-servers/open-webui.mdx This snippet demonstrates how to clone the openapi-servers repository, navigate to the time server directory, install dependencies, and start the server using uvicorn. This will host a local OpenAPI server at http://localhost:8000. ```bash git clone https://github.com/open-webui/openapi-servers cd openapi-servers cd servers/time pip install -r requirements.txt uvicorn main:app --host 0.0.0.0 --reload ``` -------------------------------- ### Complete Redis Configuration Example Source: https://github.com/open-webui/docs/blob/main/docs/tutorials/integrations/redis.md Example showing all Redis-related environment variables for multi-worker deployments, WebSocket support, and recommended settings for Sentinel and connection pooling. ```bash # Required for multi-worker/multi-instance deployments REDIS_URL="redis://redis:6379/0" # Required for websocket support ENABLE_WEBSOCKET_SUPPORT="true" WEBSOCKET_MANAGER="redis" WEBSOCKET_REDIS_URL="redis://redis:6379/1" # Recommended for Sentinel deployments (prevents failover hangs) REDIS_SOCKET_CONNECT_TIMEOUT=5 REDIS_SENTINEL_MAX_RETRY_COUNT=5 REDIS_RECONNECT_DELAY=1000 # Recommended: detect stale pooled connections (must be < Redis server timeout) REDIS_HEALTH_CHECK_INTERVAL=60 # Recommended: enable TCP keepalive for dead-peer detection at the kernel level REDIS_SOCKET_KEEPALIVE=True # Optional REDIS_KEY_PREFIX="open-webui" ``` -------------------------------- ### Start Pipelines Server Source: https://github.com/open-webui/docs/blob/main/docs/features/extensibility/pipelines/index.mdx Start the Pipelines server using the provided script. This command is part of the manual installation process. ```sh sh ./start.sh ``` -------------------------------- ### Install OpenTelemetry Dependencies Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx If you encounter ImportError or missing module errors related to OpenTelemetry, you may need to install these additional Python dependencies manually. ```bash pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp ``` -------------------------------- ### Install Optional Connectors for Knowledge Base Sync Source: https://github.com/open-webui/docs/blob/main/docs/features/knowledge-base-sync/index.md Install specific optional connectors for the knowledge base sync tool using pip extras. For example, install S3 support with `pip install oikb[s3]`. ```bash pip install oikb[s3] ``` ```bash pip install oikb[gcs] ``` ```bash pip install oikb[azure] ``` ```bash pip install oikb[dropbox] ``` ```bash pip install oikb[gdrive] ``` ```bash pip install oikb[all] ``` -------------------------------- ### WEBSOCKET_EVENT_CALLER_TIMEOUT Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Set the timeout in seconds for the server to wait for a user response to interactive prompts generated by event calls. ```bash WEBSOCKET_EVENT_CALLER_TIMEOUT=600 ``` -------------------------------- ### Response Example for OAuth Token Exchange Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx This JSON response contains the JWT session token and user information obtained after a successful OAuth token exchange. ```json { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "Bearer", "expires_at": 1735682400, "id": 1, "email": "user@example.com", "name": "John Doe", "role": "user", "profile_image_url": "https://...", "permissions": {...} } ``` -------------------------------- ### ComfyUI Image Generation Workflow Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Defines a ComfyUI workflow for image generation. Export from ComfyUI using 'Save (API Format)' to ensure compatibility. This JSON structure specifies the nodes and their connections for the generation process. ```json { "3": { "inputs": { "seed": 0, "steps": 20, "cfg": 8, "sampler_name": "euler", "scheduler": "normal", "denoise": 1, "model": ["4", 0], "positive": ["6", 0], "negative": ["7", 0], "latent_image": ["5", 0] }, "class_type": "KSampler", "_meta": { "title": "KSampler" } }, "4": { "inputs": { "ckpt_name": "model.safetensors" }, "class_type": "CheckpointLoaderSimple", "_meta": { "title": "Load Checkpoint" } }, "5": { "inputs": { "width": 512, "height": 512, "batch_size": 1 }, "class_type": "EmptyLatentImage", "_meta": { "title": "Empty Latent Image" } }, "6": { "inputs": { "text": "Prompt", "clip": ["4", 1] }, "class_type": "CLIPTextEncode", "_meta": { "title": "CLIP Text Encode (Prompt)" } }, "7": { "inputs": { "text": "", "clip": ["4", 1] }, "class_type": "CLIPTextEncode", "_meta": { "title": "CLIP Text Encode (Prompt)" } }, "8": { "inputs": { "samples": ["3", 0], "vae": ["4", 2] }, "class_type": "VAEDecode", "_meta": { "title": "VAE Decode" } }, "9": { "inputs": { "filename_prefix": "ComfyUI", "images": ["8", 0] }, "class_type": "SaveImage", "_meta": { "title": "Save Image" } } } ``` -------------------------------- ### Navigate to Open WebUI Installation Directory (Local) Source: https://github.com/open-webui/docs/blob/main/docs/troubleshooting/manual-database-migration.md For local installations, navigate to the Open WebUI backend directory. Activate your virtual environment if one is in use. ```bash # Navigate to Open WebUI installation cd /path/to/open-webui/backend/open_webui # Activate virtual environment if used source ../../venv/bin/activate # Linux/Mac # venv\Scripts\activate # Windows ``` -------------------------------- ### Install Open WebUI Helm Chart Source: https://github.com/open-webui/docs/blob/main/docs/getting-started/quick-start/tab-kubernetes/Helm.md Command to install the Open WebUI application using the previously added Helm chart. This deploys Open WebUI to your Kubernetes cluster. ```bash helm install openwebui open-webui/open-webui ``` -------------------------------- ### Image Prompt Generation Template Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Specifies the template used for generating image prompts. This template guides the AI in creating detailed descriptions for image generation tasks. ```text ### Task: Generate a detailed prompt for an image generation task based on the given language and context. Describe the image as if you were explaining it to someone who cannot see it. Include relevant details, colors, shapes, and any other important elements. ### Guidelines: - Be descriptive and detailed, focusing on the most important aspects of the image. - Avoid making assumptions or adding information not present in the image. - Use the chat's primary language; default to English if multilingual. - If the image is too complex, focus on the most prominent elements. ### Output: Strictly return in JSON format: { "prompt": "Your detailed description here." } ### Chat History: {{MESSAGES:END:6}} ``` -------------------------------- ### Basic .oikb.yaml Configuration Source: https://github.com/open-webui/docs/blob/main/docs/features/knowledge-base-sync/daemon.md Example `.oikb.yaml` file for configuring multiple knowledge base sources, including default settings and source-specific overrides for interval and notifications. ```yaml defaults: interval: 1h concurrency: 4 filter: max-size: 50mb sources: - name: wiki source: github:owner/repo kb-id: 8f3a2b1c-... webhook: true - name: handbook source: confluence:ENG kb-id: 4e7d9a0f-... interval: "0 6 * * 1-5" notify: url: https://hooks.slack.com/services/T.../B.../xxx on: error ``` -------------------------------- ### AUTOMATIC1111 API Parameters Example Source: https://github.com/open-webui/docs/blob/main/docs/reference/env-configuration.mdx Pass additional parameters to AUTOMATIC1111 API requests. This JSON object allows for customization of generation settings like CFG scale, sampler, and scheduler. ```json { "cfg_scale": 7, "sampler_name": "Euler a", "scheduler": "normal" } ```