Guides

How to Set Up the DuckDB Local UI for CSV Analysis

Arkzero ResearchApr 3, 20266 min read

Last updated Apr 3, 2026

DuckDB's local UI is a browser-based SQL notebook that runs entirely on your machine, letting you query CSV, Parquet, and JSON files with standard SQL and zero server setup. Install DuckDB v1.2.1 or later, run "duckdb -ui" in your terminal, and the interface opens automatically with syntax highlighting, autocomplete, and real-time result previews. Your data never leaves your computer unless you explicitly connect to a cloud service.
DuckDB logo displayed on a clean professional background

What the DuckDB Local UI Does

DuckDB is an embedded analytical database that runs inside your own process with no server to install or manage. Starting with version 1.2.1, it ships with a built-in local UI: a SQL notebook environment that opens in your browser and connects directly to your local files and memory. You get syntax highlighting, autocomplete, column profiling, and real-time query results without uploading anything to a third party.

This guide walks through installing DuckDB, launching the UI, loading a CSV file, and running practical queries. Everything runs locally. No cloud account, no API key, no configuration file.

Who This Is For

The DuckDB local UI fits anyone who works with tabular data but wants to skip the overhead of setting up a database server or writing Python scripts. Operations managers pulling numbers from exported CSVs, analysts exploring datasets before building dashboards, and founders who need quick answers from their data without waiting for engineering support will all find it useful.

If you already use tools like Excel or Google Sheets for ad hoc analysis but hit performance walls on larger files (anything above a few hundred thousand rows), DuckDB handles those workloads without breaking a sweat.

Step 1: Install DuckDB

DuckDB is a single binary with no dependencies. Pick your platform:

macOS (Homebrew):

brew install duckdb

Linux, macOS, or WSL:

curl -s https://install.duckdb.org | sh

Windows:

Download the latest release from the DuckDB GitHub releases page, unzip the file, and add the folder to your PATH. No installer required.

Confirm the installation by running:

duckdb --version

You need version 1.2.1 or later for the UI extension.

Step 2: Launch the Local UI

Open your terminal and run:

duckdb -ui

DuckDB checks whether the UI extension is installed, downloads it automatically if needed, starts a local web server, and opens the interface in your default browser. The first launch takes a few seconds longer while the extension downloads. Subsequent launches are near-instant.

You can also launch the UI from inside any DuckDB session (CLI, Python, Java) by running:

CALL start_ui();

The left sidebar shows attached databases and any files you have loaded. The main panel is a notebook where you write and run SQL cells.

Step 3: Load and Explore a CSV File

DuckDB reads CSV files directly without importing them into a database first. In a notebook cell, run:

SELECT * FROM read_csv('path/to/your/file.csv') LIMIT 10;

Replace the path with the actual location of your file. DuckDB auto-detects column types, delimiters, and headers. To inspect the detected schema:

DESCRIBE SELECT * FROM read_csv('path/to/your/file.csv');

This returns every column name, its inferred data type, and any constraints. If DuckDB guesses a type wrong (dates read as strings is the most common case), you can override it:

SELECT * FROM read_csv('path/to/your/file.csv',
  columns={'order_date': 'DATE', 'amount': 'DOUBLE'});

Click any table in the left sidebar to see a summary panel with row counts, column types, and data profiles showing distributions, null percentages, and min/max values.

Step 4: Run Analytical Queries

Once your CSV is loaded, standard SQL works exactly as you would expect. Here are patterns that cover most day-to-day analysis tasks.

Summary statistics:

SELECT
    COUNT(*) AS total_rows,
    MIN(amount) AS min_amount,
    MAX(amount) AS max_amount,
    ROUND(AVG(amount), 2) AS avg_amount
FROM read_csv('sales.csv');

Group and rank:

SELECT category,
       COUNT(*) AS transactions,
       SUM(amount) AS total_revenue,
       ROUND(AVG(amount), 2) AS avg_order
FROM read_csv('sales.csv')
GROUP BY category
ORDER BY total_revenue DESC;

Filter and sort:

SELECT customer_name, order_date, amount
FROM read_csv('sales.csv')
WHERE amount > 500
ORDER BY order_date DESC;

The UI updates results in real time as you type when Instant SQL mode is enabled. You can also sort, filter, and reorder result columns directly in the output panel without rewriting queries.

Step 5: Save Your Work and Export Results

Notebooks persist automatically in a local database stored at ~/.duckdb/extension_data/ui/ui.db. You can create multiple named notebooks to organize different projects.

To export query results to a new file:

COPY (
    SELECT category, SUM(amount) AS total
    FROM read_csv('sales.csv')
    GROUP BY category
) TO 'summary.csv' (HEADER, DELIMITER ',');

DuckDB also supports exporting to Parquet for better compression and faster re-reads on large datasets:

COPY (SELECT * FROM read_csv('sales.csv')) TO 'sales.parquet' (FORMAT PARQUET);

Working With Multiple Files

One of DuckDB's strongest features is querying across multiple files in a single statement. If you have monthly CSV exports in a folder:

SELECT * FROM read_csv('exports/2026-*.csv') LIMIT 100;

DuckDB uses glob patterns to combine files automatically, treating them as a single table. This is useful when you receive data in batches and want to analyze the full picture without manually merging spreadsheets.

Performance Notes

DuckDB processes CSV files significantly faster than spreadsheet tools because it uses columnar execution and vectorized processing. In benchmarks published by the DuckDB team, a 1 GB CSV file loads in seconds on modern hardware. A dataset that crashes Excel at 500,000 rows runs smoothly in DuckDB with millions of rows.

The local UI adds minimal overhead since it communicates with DuckDB through an efficient binary format that matches its in-memory data representation. Results transfer to the browser nearly as fast as they compute.

Privacy and Data Security

Everything in the DuckDB local UI runs on your machine. Your queries and data never leave your computer. The only exception is if you explicitly enable MotherDuck integration, which connects to a cloud service for persistence and team sharing. By default, the UI is fully offline-capable after the initial extension download.

This makes DuckDB a strong choice for analyzing sensitive data that cannot be uploaded to cloud-based analytics tools.

If you want to skip the SQL entirely and get analysis from a plain English prompt, VSLZ AI lets you upload a CSV and ask questions in natural language to get charts, statistics, and insights without writing any code.

What to Try Next

Once you are comfortable with the basics, explore DuckDB's ability to attach external databases. You can query a live PostgreSQL database alongside local CSV files in the same notebook:

ATTACH 'postgres:dbname=mydb user=myuser' AS pg;
SELECT * FROM pg.public.orders
JOIN read_csv('local_inventory.csv') AS inv
ON pg.public.orders.sku = inv.sku;

You can also query remote Parquet files stored in S3 buckets, making the local UI a lightweight gateway to cloud data without installing heavyweight BI tools.

FAQ

Do I need to install a database server to use DuckDB?

No. DuckDB is an embedded database that runs as a single binary with no server process, no configuration files, and no dependencies. You download it, run it, and start querying files immediately.

Can DuckDB handle large CSV files that crash Excel?

Yes. DuckDB uses columnar execution and vectorized processing, which lets it handle files with millions of rows on standard laptop hardware. A 1 GB CSV typically loads in seconds. Excel usually struggles beyond 500,000 to 1 million rows.

Is my data sent to the cloud when using the DuckDB local UI?

No. The local UI runs entirely on your machine. Your queries and data stay local unless you explicitly enable MotherDuck cloud integration, which is an optional opt-in feature.

What file formats does DuckDB support besides CSV?

DuckDB natively reads CSV, Parquet, and JSON files. It can also attach PostgreSQL databases, read from S3-compatible object stores, and query remote DuckDB databases. The Parquet format is recommended for large datasets because it offers better compression and faster read performance.

How do I query multiple CSV files at once in DuckDB?

Use glob patterns in the file path. For example, SELECT * FROM read_csv('data/2026-*.csv') combines all matching files into a single virtual table. DuckDB handles schema alignment automatically as long as the files share the same column structure.

Related

Julius AI logo on a clean background
Guides

How to Set Up Julius AI for Data Analysis

Julius AI is a browser-based tool that lets you upload spreadsheets, CSVs, or connect a live database and analyze data through plain-English questions. It runs Python under the hood and returns charts, tables, and written summaries. The free plan is limited to 15 messages per month. Paid plans start at $35 per month and unlock faster models, larger file handling, and live database connectors.

Arkzero Research · Apr 4, 2026
How to Switch from Pandas to Polars for Faster Analysis
Guides

How to Switch from Pandas to Polars for Faster Analysis

Polars is a DataFrame library built in Rust that processes CSV and tabular data significantly faster than Pandas, with benchmarks showing 2.5x to 11x speed improvements depending on the operation. This guide covers installing Polars, translating the most common Pandas operations into Polars syntax, and deciding when the switch makes sense based on dataset size and workflow needs.

Arkzero Research · Apr 4, 2026
How to Set Up a Databricks Genie Space hero image
Guides

How to Set Up a Databricks Genie Space

Databricks Genie is a natural language analytics interface built into the Databricks Lakehouse platform. Business users ask questions in plain English and Genie translates them into SQL, runs the query against Unity Catalog data, and returns results without requiring SQL knowledge. Setting up a Genie space requires Unity Catalog data registration, a pro or serverless SQL warehouse, and a knowledge store built with table descriptions, synonyms, example SQL queries, and join definitions.

Arkzero Research · Apr 3, 2026