The DuckDB Local UI

Jeff Raymakers and Gabor Szarnyas
Published on 2025-03-12

TL;DR: The DuckDB team and MotherDuck are excited to announce the release of a built-in local UI for DuckDB.

The DuckDB project was built to make it simple to leverage modern database technology. DuckDB can be used from many popular languages and runs on a wide variety of platforms. The included Command Line Interface (CLI) provides a convenient way to interactively run SQL queries from a terminal window, and several third-party tools offer more sophisticated UIs.

The DuckDB CLI provides advanced features like interactive multi-line editing, auto-complete, and progress indicators. However, it can be cumbersome for working with lengthy SQL queries, and its data exploration tools are limited. Many of the available third party UIs are great, but selecting, installing, and configuring one is not straightforward. Using DuckDB through a UI should be as simple as using the CLI. And now it is!

The DuckDB UI is the result of a collaboration between DuckDB Labs and MotherDuck.

Introducing the DuckDB UI

Starting with DuckDB v1.2.1, a full-featured local web user interface is available out-of-the-box! You can start it from the terminal by launching the DuckDB CLI client with the -ui argument:

duckdb -ui

You can also run the following SQL command from a DuckDB client (e.g., CLI, Python, Java, etc.):

CALL start_ui();

Either of these approaches will open the DuckDB UI in your browser:

The DuckDB UI uses interactive notebooks to define SQL scripts and show the results of queries. However, its capabilities go far beyond this. Let’s go over its main features.

The DuckDB UI runs all your queries locally: your queries and data never leave your computer. If you would like to use MotherDuck through the UI, you have to opt-in explicitly.

Features

Databases

Your attached databases are shown on the left. This list includes in-memory databases plus any files and URLs you’ve loaded. You can explore tables and views by expanding databases and schemas.

Table Summary

Click on a table or view to show a summary below. The UI shows the number of rows, the name and type of each column, and a profile of the data in each column.

Select a column to see a more detailed summary of its data. You can use the “Preview data” button near the top right to inspect the first 100 rows. You can also find the SQL definition of the table or view here.

Notebooks

You can organize your work into named notebooks. Each cell of the notebook can execute one or more SQL statements. The UI supports syntax highlighting and autocomplete to assist with writing your queries.

You can run the whole cell, or just a selection, then sort, filter, or further transform the results using the provided controls.

Column Explorer

The right panel contains the Column Explorer, which shows a summary of your results. You can dive into each column to gain insights.

MotherDuck Integration

If you would like to connect to MotherDuck, you can sign into MotherDuck to persist files and tables to a cloud data warehouse crafted for using DuckDB at scale and sharing data with your team.

…And More!

The DuckDB UI is under active development. Expect additions and improvements!

Footprint

Like the DuckDB CLI, the DuckDB UI creates some files in the .duckdb directory in your home directory. The UI puts its files in a sub-directory, extension_data/ui:

  • Your notebooks and some other state are stored in a DuckDB database, ui.db.
  • When you export data to the clipboard or a file (using the controls below the results), some tiny intermediate files (e.g. ui_export.csv) are generated. Your data is cleared from these files after the export is completed, but some near-empty files remain, one per file type.

Internals

Support for the UI is implemented in a DuckDB extension. The extension embeds a localhost HTTP server, which serves the UI browser application, and also exposes an API for communication with DuckDB. In this way, the UI leverages the native DuckDB instance from which it was started, enabling full access to your local memory, compute, and file system.

Results are returned in an efficient binary form closely matching DuckDB’s in-memory representation (DataChunk). Server-sent events enable prompt notification of updates such as attaching databases. These techniques and others make for a low-latency experience that keeps you in your flow.

See the UI extension documentation for more details.

Summary

In this blog post, we presented the new DuckDB UI, a powerful web interface for DuckDB.

The DuckDB UI shares many of its design principles with the DuckDB database. It’s simple, fast, feature-rich, and portable, and runs locally on your computer. The DuckDB UI is also fully open source: visit the duckdb/duckdb-ui repository if you want to dive in deeper.

For help or to share feedback, please file an issue, join the #ui channel in either the DuckDB Discord or the MotherDuck Community Slack.

Happy quacking!