Run DSUI in production
Pin versions, persist and back up data, set the master key, and put DSUI behind a reverse proxy.
On this page
This guide covers what to settle before other people rely on your DSUI installation: which version runs, where its data lives, how its encryption key is stored, and how people reach it.
Pin the versions#
By default, the quickstart follows the latest release and the main branch of the adapters. For a repeatable deployment, pin all three:
- DSUI: use a release version in place of
latest, such asghcr.io/northgraindata/dsui:release_versionfor Docker, ornpx @northgraindata/dsui@release_version. Releases publish the image and the npm package with the same version - Adapters: set
refto a tag or a commit SHA that you reviewed. Without aref, DSUI builds the adapter frommain - Plugins: set
refthe same way on eachsource: gitplugin
adapters:
postgresql:
source: git
repository: "git+https://github.com/northgraindata/dsui"
ref: a_reviewed_commit_sha
path: packages/adapter-postgresqlKeep the data directory#
DSUI stores its state in a data directory. It holds the database (dsui.sqlite), the files that adapters and plugins store (blobs), and the master key (.master-key).
- npx:
~/.local/share/dsui. SetDSUI_DATA_DIRto change it. DSUI also followsXDG_DATA_HOME - Docker:
/data. Mount a volume there, so state survives a new container
Back up the whole directory, including .master-key. Without the key, DSUI can’t read the connections that people saved in the workspace.
DSUI builds adapters from source when it starts. In Docker, the package cache lives on the /data volume, so a restart doesn’t download dependencies again.
Set the master key yourself#
DSUI encrypts connections that people save in the workspace with a master key. If you don’t set one, DSUI creates a key in .master-key in the data directory the first time it starts.
For Docker, CI, or more than one instance, set the key yourself so it doesn’t depend on a file. It must be a base64-encoded 32-byte key:
openssl rand -base64 32Pass the result as DSUI_MASTER_KEY. Store it in your secret manager, and keep the same value across restarts and upgrades.
Put DSUI behind a reverse proxy#
DSUI binds to 0.0.0.0 on port 4192. Set DSUI_HOST and DSUI_PORT to change that.
DSUI has no sign-in of its own, and it terminates no TLS. Run it behind a reverse proxy that handles both, or keep it on a private network. Without an authentication plugin, everyone who can reach DSUI is the owner. See how DSUI works.
- Forward requests to DSUI and keep the
Hostheader - Allow WebSocket upgrades if you use DSUI Agents
- Set
DSUI_TRUST_PROXY=1so DSUI shows an agent’s real address instead of the proxy’s
Host DSUI under a URL prefix#
To serve DSUI at a path such as /dsui, build the image from a checkout of the repository with the prefix. The workspace’s files are built for one prefix, so you can’t change it at run time:
docker build --build-arg DSUI_WEB_BASE_PATH=/dsui/ -t your_registry/dsui .Configure the proxy to route /dsui to the container and to strip the prefix. The default, /, serves DSUI from the root of the host.
Choose telemetry#
DSUI sends anonymous usage counts by default. See telemetry for what it sends and how to turn it off.