mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 11:28:35 -05:00
[GH-ISSUE #16112] feat: encryption at rest with url like sqlite+sqlcipher://
#33314
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rndmcnlly on GitHub (Jul 29, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16112
Check Existing Issues
Problem Description
I'd like to do a low-resource deployment of OWUI while encrypting user data at rest. In the past, I configured
DATABASE_URLto point at a remote encrypted database instance, but I want to get the same effect within a single Docker container (like the default setup with sqlite, but encrypted).Desired Solution you'd like
I'd like OWUI to check the the
DATABASE_URLconfig for URLs likesqlite+sqlcipher://and to use thesqlcipher3Python package set up the connection before handing it back to the existing SQLAlchemy machinery. OWUI already contains URL parsing logic to customize engine creation in other ways.Alternatives Considered
sqlite+pysqlcipher://(note the "py")SQLAlchemy already has some awareness of the SQLCipher URL scheme, but the drivers have long gone unsupported and the official docs recommend using the alternative
sqlcipher3driver instead: https://docs.sqlalchemy.org/en/20/dialects/sqlite.html#pysqlcipherAdditional Context
Here's a sketch of how to customize the
creatorargument ofcreate_engineto achieve the desired behavior:Even though big enterprise users will have their own encrypted database solution, showing that OWUI can be configured to support encryption at rest might help people run the small-scale pilot projects that let you snag those bigger enterprise customers later on.
Hat tip to the creator of the Cotypist LLM-based autocomplete app for explaining to me how to use SQLCipher to easily protect sensitive user data in a system that is already using SQLite. Both OWUI and Cotypist involve people typing potentially sensitive things into LLMs while not entirely trusting the system administrators to keep the host disk fully private.
@tjbck commented on GitHub (Jul 29, 2025):
Agreed, PR welcome!