In this article, I will show you how to use PostgreSQL Database with OpenWebUI.
Open WebUI is an extensible, feature-rich, and user-friendly self-hosted AI platform designed to operate entirely offline. It supports various LLM runners like Ollama and OpenAI-compatible APIs, with a built-in inference engine for RAG, making it a powerful AI deployment solution.
I have installed OpenWebUI on Kubernetes with Helm. If you want to see how to install OpenWebUI with helm follow this link How to install OpenWebUI on Kubernetes with helm
To use the external Postgresql database you have to add DATABSE_URL
in the env variable. Here is an example of values.yaml
extraEnvVars:
- name: DATABASE_URL
value: postgresql://user:password@hostname/dbname
- name: VECTOR_DB
value: pgvector
You have to make sure your Database has the pgvector extension enabled. Check the next part to learn how to enable the pgvector extension.
Enable PGVECTOR extension in Azure PostgreSQL Database
CREATE EXTENSION IF NOT EXISTS vector;
the above command will create the vector extension.
If you want to verify it it’s created successfully you can use the following command.
Verify PGVECTOR extension in Azure PostgreSQL Database
SELECT extname FROM pg_extension WHERE extname = 'vector';
Please let me know if you are facing any issues to use Postgresql Database with OpenWebUI.