Run DSUI with Docker
Run DSUI from the official container image with Docker Compose and a file-backed DuckDB database.
On this page
In this tutorial, you run DSUI in a container, keep its data in a volume, and query a DuckDB database file. You need Docker with Compose and network access to GitHub, because DSUI builds the adapter from source the first time it starts.
DSUI doesn’t start the services you configure. It connects to services that are already running, so a database in your Compose file runs as its own container.
Add a configuration file#
Create
dsui.yaml:yamladapters: duckdb: source: git repository: "git+https://github.com/northgraindata/dsui" path: packages/adapter-duckdb services: - id: warehouse adapter: duckdb name: Analytics warehouse connection: method: file path: /data/warehouse.duckdbThe
filemethod opens a DuckDB database atpathon the container’s filesystem. DuckDB creates the file if it doesn’t exist.Add a Compose file#
Create
compose.yamlnext to it:yamlservices: dsui: image: ghcr.io/northgraindata/dsui:latest ports: - "4192:4192" volumes: - ./dsui.yaml:/etc/dsui/dsui.yaml:ro - dsui-data:/data volumes: dsui-data:The image reads
/etc/dsui/dsui.yamlby default. SetDSUI_CONFIGto use a different path. The/datavolume holds DSUI’s database, its encryption key, the adapter build cache, and your DuckDB file.Start DSUI#
bashdocker compose up -d docker compose logs -f dsuiThe log prints
readyand the addresshttp://localhost:4192when the server is up.Run a query#
Open
http://localhost:4192, select Analytics warehouse, and open Query. Run this statement:sqlselect 42 as answer;The result is one row with the value
42. The database file lives in thedsui-datavolume, so it survivesdocker compose down.
Pin the adapter version#
Without a ref, DSUI builds the adapter from the main branch. For a repeatable deployment, set ref to a tag or a commit SHA that you reviewed:
adapters:
duckdb:
source: git
repository: "git+https://github.com/northgraindata/dsui"
ref: a_reviewed_commit_sha
path: packages/adapter-duckdbFile permissions#
The container runs as user ID 65532, not as root. A named volume works without changes. If you mount a host directory at /data instead, make it writable by that user ID.