Skip to content

Open WebUI

Open WebUI is an extensible, feature-rich, and user-friendly self-hosted AI platform designed to operate entirely offline. It supports LLM runners such as Ollama and OpenAI-compatible APIs. Its built-in inference engine supports retrieval-augmented generation (RAG), making it a powerful AI deployment solution.

Install Open WebUI

  1. Follow the Open WebUI installation guide.
  2. Install Open WebUI using either the Docker or Python package method.
  3. Start the Open WebUI service.
  4. Access Open WebUI on port 3000.
  1. Follow the Open WebUI Quick Start guide to set up the self-hosted Open WebUI requirements, including the .env file.
  2. Create ls-net network with following command:

docker network inspect ls-net >/dev/null 2>&1 || docker network create ls-net
3. Add the following ls-net external network to the Open WebUI and Ollama project’s docker-compose.yml file:

```yaml
services:
  ollama:
    image: ollama/ollama:latest
    container_name: ollama
    volumes:
      - ollama:/root/.ollama
    restart: unless-stopped

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    volumes:
      - open-webui:/app/backend/data
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
    depends_on:
      - ollama
    ports:
      - "3000:8080"
    restart: unless-stopped

volumes:
  ollama:
  open-webui:

networks:
  default:
    name: ls-net
    external: true
```

Set up OpenLiteSpeed (OLS) proxy with AutoSSL

The easiest way to install OpenLiteSpeed, configure it as a reverse proxy, and enable AutoSSL is to use the ols1clk script.

Before continuing, ensure that your domain points to the server.

Replace www.example.com with your domain name, and run the following command:

bash <(curl -fsSL https://raw.githubusercontent.com/litespeedtech/ols1clk/master/ols1clk.sh) --proxy-c --proxy-port 3000 --proxy-s --autocert --sitedomain www.example.com

This command automatically:

  1. Download the ols-proxy-docker-env repository:

    git clone https://github.com/litespeedtech/ols-proxy-docker-env
    cd ols-proxy-docker-env
    
  2. Copy the example environment file:

    cp .env.example .env
    
  3. Edit .env with your configuration values:

    OLS_IMAGE=litespeedtech/openlitespeed:latest
    BACKEND_IP=open-webui
    BACKEND_PORT=8080
    DOMAIN=www.example.com
    PROXY_METHOD=context
    PROXY_SOCKET=true
    ACME_EMAIL=admin@example.com
    
  4. Start the proxy:

    docker compose up -d
    

Verify the proxy configuration

Open https://www.example.com in a browser. The application interface should load through OpenLiteSpeed over HTTPS.

Warning

After verifying the configuration, restrict public access to port 3000 using your firewall. Alternatively, you can configure the service to listen on 127.0.0.1 only, so port 3000 is not publicly accessible.

Optional settings

You can further enhance your site's security by enabling additional security features in the .env file, such as:

These other security features can be configured through the WebAdmin Console:

See the OpenLiteSpeed Security Guide for more information.

Warning

Some security features may interfere with application services or block legitimate requests. Test these settings thoroughly before applying them in a production environment.