open-webui / helm-charts

70 stars 47 forks source link

Postgres for persistence storage #83

Closed hongbo-miao closed 2 months ago

hongbo-miao commented 2 months ago

It seems this pull request allows using Postgres for Open WebUI storage

It would be great to support / document as well, thank you! ☺️

0xThresh commented 2 months ago

Hey @hongbo-miao, I believe all you would need to do is add your Postgres connection string as a value to extraEnvVars, such as:

extraEnvVars:
- name: "DATABASE_URL"
  value: "postgresql://[user[:password]@][host][:port][/dbname][?param1=value1&...]"

You can see more in the Open WebUI docs here: https://docs.openwebui.com/getting-started/env-configuration/#database_url

Please report back on whether or not this works for you, thanks!

hongbo-miao commented 2 months ago

Thanks @0xThresh ! I am wondering in this case, if I set

persistence:
  enabled: false

Could Open WebUI fully use external Postgres to save all data? I created a question at https://github.com/open-webui/open-webui/discussions/5746

In the meanwhile, I will do some tests as well when got time, thanks! ☺️

tjbck commented 2 months ago

@hongbo-miao yes, except for uploaded files

hongbo-miao commented 2 months ago

Thanks @tjbck for the info! 😃 It makes sense. So I assume I still have to use Kubernetes persistence storage for uploaded files. In future, if it could support S3 as storage, that would be awesome! I opened a feature request at https://github.com/open-webui/open-webui/issues/5763 I will close this for now. Once Open WebUI supports S3 for user uploaded files, I will test Postgres + S3. Thanks!