pgvector as vector database #85

Closed
opened 2026-02-15 19:16:07 -05:00 by yindo · 2 comments
Owner

Originally created by @terchris on GitHub (Jun 1, 2025).

How to set up pgvector as vector database?

I have the following docker compose that uses pgvector. How to use pgvector as database like this image: pgvector/pgvector:pg15 in the helm chart?

services:
  openwebui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: openwebui
    ports:
      - "8080:8080"
    environment:
      # Database Configuration
      - DATABASE_URL=postgresql://openwebui:openwebui@db:5432/openwebui
      - VECTOR_DB=pgvector
      - PGVECTOR_DB_URL=postgresql://openwebui:openwebui@db:5432/openwebui
      
      # Ollama Configuration - pointing to native Mac installation using rancher desktop
      - OLLAMA_BASE_URL=http://host.lima.internal:11434
      
      # RAG Configuration
      - CHUNK_SIZE=${CHUNK_SIZE:-1000}
      - CHUNK_OVERLAP=${CHUNK_OVERLAP:-200}
      - RAG_EMBEDDING_ENGINE=ollama
      - RAG_EMBEDDING_MODEL=${RAG_EMBEDDING_MODEL:-nomic-embed-text:latest}

      # Tika Document Extraction
      - TIKA_SERVER_URL=http://tika:9998

      # Security
      - WEBUI_SECRET_KEY=${WEBUI_SECRET_KEY}
      
      # Admin Configuration
      - ADMIN_EMAIL=${ADMIN_EMAIL}
      
      # OIDC Configuration for Okta Red Cross
      - ENABLE_OAUTH_SIGNUP=true
      - OAUTH_MERGE_ACCOUNTS_BY_EMAIL=true
      - OAUTH_PROVIDER_NAME=${OAUTH_PROVIDER_NAME}
      - OPENID_PROVIDER_URL=${OPENID_PROVIDER_URL}
      - OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID}
      - OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET}
      - OPENID_REDIRECT_URI=${OPENID_REDIRECT_URI}
      - OAUTH_SCOPES=openid email profile
      
      # OpenAI Configuration (if needed)
      - OPENAI_API_KEY=${OPENAI_API_KEY:-}
      

      
    volumes:
      - openwebui-data:/app/backend/data
    depends_on:
      - db
      - tika
    restart: unless-stopped
    networks:
      - openwebui-network

  db:
    image: pgvector/pgvector:pg15
    container_name: openwebui-db
    environment:
      - POSTGRES_USER=openwebui
      - POSTGRES_PASSWORD=openwebui
      - POSTGRES_DB=openwebui
    ports:
      - "5432:5432"
    volumes:
      - db-data:/var/lib/postgresql/data
    restart: unless-stopped
    networks:
      - openwebui-network

  tika:
    image: apache/tika:latest-full
    container_name: tika
    restart: unless-stopped
    ports:
      - "9998:9998"
    networks:
      - openwebui-network

volumes:
  openwebui-data:
  db-data:
  pgadmin-data:

networks:
  openwebui-network:
    driver: bridge

Originally created by @terchris on GitHub (Jun 1, 2025). How to set up pgvector as vector database? I have the following docker compose that uses pgvector. How to use pgvector as database like this `image: pgvector/pgvector:pg15` in the helm chart? ```yaml services: openwebui: image: ghcr.io/open-webui/open-webui:main container_name: openwebui ports: - "8080:8080" environment: # Database Configuration - DATABASE_URL=postgresql://openwebui:openwebui@db:5432/openwebui - VECTOR_DB=pgvector - PGVECTOR_DB_URL=postgresql://openwebui:openwebui@db:5432/openwebui # Ollama Configuration - pointing to native Mac installation using rancher desktop - OLLAMA_BASE_URL=http://host.lima.internal:11434 # RAG Configuration - CHUNK_SIZE=${CHUNK_SIZE:-1000} - CHUNK_OVERLAP=${CHUNK_OVERLAP:-200} - RAG_EMBEDDING_ENGINE=ollama - RAG_EMBEDDING_MODEL=${RAG_EMBEDDING_MODEL:-nomic-embed-text:latest} # Tika Document Extraction - TIKA_SERVER_URL=http://tika:9998 # Security - WEBUI_SECRET_KEY=${WEBUI_SECRET_KEY} # Admin Configuration - ADMIN_EMAIL=${ADMIN_EMAIL} # OIDC Configuration for Okta Red Cross - ENABLE_OAUTH_SIGNUP=true - OAUTH_MERGE_ACCOUNTS_BY_EMAIL=true - OAUTH_PROVIDER_NAME=${OAUTH_PROVIDER_NAME} - OPENID_PROVIDER_URL=${OPENID_PROVIDER_URL} - OAUTH_CLIENT_ID=${OAUTH_CLIENT_ID} - OAUTH_CLIENT_SECRET=${OAUTH_CLIENT_SECRET} - OPENID_REDIRECT_URI=${OPENID_REDIRECT_URI} - OAUTH_SCOPES=openid email profile # OpenAI Configuration (if needed) - OPENAI_API_KEY=${OPENAI_API_KEY:-} volumes: - openwebui-data:/app/backend/data depends_on: - db - tika restart: unless-stopped networks: - openwebui-network db: image: pgvector/pgvector:pg15 container_name: openwebui-db environment: - POSTGRES_USER=openwebui - POSTGRES_PASSWORD=openwebui - POSTGRES_DB=openwebui ports: - "5432:5432" volumes: - db-data:/var/lib/postgresql/data restart: unless-stopped networks: - openwebui-network tika: image: apache/tika:latest-full container_name: tika restart: unless-stopped ports: - "9998:9998" networks: - openwebui-network volumes: openwebui-data: db-data: pgadmin-data: networks: openwebui-network: driver: bridge ```
yindo closed this issue 2026-02-15 19:16:07 -05:00
Author
Owner

@davidshen84 commented on GitHub (Jul 27, 2025):

https://docs.openwebui.com/getting-started/env-configuration#pgvector

This should be a good start. It did not mention about secrets, so I guess the db url should contain the full credential.

@davidshen84 commented on GitHub (Jul 27, 2025): https://docs.openwebui.com/getting-started/env-configuration#pgvector This should be a good start. It did not mention about secrets, so I guess the db url should contain the full credential.
Author
Owner

@westbrook-ai commented on GitHub (Aug 7, 2025):

Agreed with davidshen84 on this one, I believe you will need to put the full DB connection string including creds in the PGVECTOR_DB_URL env var. If you'd like more specific environment variables on Open WebUI for that, please open an issue on the Open WebUI repo.

Closing this one out since it's not related to the Helm charts.

@westbrook-ai commented on GitHub (Aug 7, 2025): Agreed with davidshen84 on this one, I believe you will need to put the full DB connection string including creds in the `PGVECTOR_DB_URL` env var. If you'd like more specific environment variables on Open WebUI for that, please open an issue on the [Open WebUI](https://github.com/open-webui/open-webui) repo. Closing this one out since it's not related to the Helm charts.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: open-webui/helm-charts#85