How to Install DuckDB on Ubuntu: The In-Process SQL OLAP Database
DuckDB is an in-process SQL OLAP database, frequently summed up as “SQLite for analytics”. It embeds directly in your process — there is no server to start and nothing to administer — yet its columnar, vectorised execution engine is tuned for the kind of heavy analytical queries that would bring a row-oriented store to its knees.
The feature that wins people over is direct file querying. DuckDB can run SQL against CSV, Parquet, and JSON files in place, with no loading step, and it can scan an entire directory of Parquet files as a single logical table. That makes its command-line shell a superb tool for ad-hoc analysis: open the shell, point a query at your data, and get answers in seconds, all from one self-contained binary.
Ubuntu does not include DuckDB in its official archive, so you would normally download a release binary by hand or install a language binding. The unofficial deb.griffo.io repository provides a maintained .deb of the CLI, letting you install DuckDB with apt and keep it current through your normal system upgrades.
What Makes DuckDB Special?
- ⚡ Columnar, vectorised engine — built for analytics, aggregations, and joins over large data
- 🧩 Embedded and serverless — runs in-process with zero configuration
- 📁 Direct file querying — SQL over CSV, Parquet, and JSON with no import step
- 🐘 Full-featured SQL — window functions, CTEs,
QUALIFY, and nested list/struct types - 🔌 On-demand extensions — pull in
httpfs,parquet,json, orspatialas needed - 💾 Portable single-file databases — persist a whole database to one
.duckdbfile - 🚀 High-speed Parquet I/O — read and write columnar files extremely quickly
- 🌐 Remote data access — query files over HTTP and S3 via the
httpfsextension
Why Use the deb.griffo.io Repository?
For Ubuntu users, the deb.griffo.io repository keeps DuckDB simple:
- Easy installation and updates through APT, Ubuntu’s native package manager
- Automatic dependency management handled by the packaging
- Tracks upstream releases so new features arrive without waiting
- No hand-managed binaries to download and place on your
PATH - Works across supported Ubuntu releases from Jammy through the latest LTS and beyond
Prerequisites
Have the following ready:
- An Ubuntu system (Jammy 22.04 LTS, Noble 24.04 LTS, or newer)
- A user with
sudoprivileges curlinstalled (sudo apt install curlif needed)
Step 1: Add the deb.griffo.io Repository
Add the key and repository with the commands below:
# Create the keyrings directory
sudo install -d -m 0755 /etc/apt/keyrings
# Download and install the repository GPG key
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
# Add the repository (auto-detects your distro codename)
echo "deb [signed-by=/etc/apt/keyrings/deb.griffo.io.gpg] https://deb.griffo.io/apt $(lsb_release -sc 2>/dev/null) main" | sudo tee /etc/apt/sources.list.d/deb.griffo.io.list > /dev/null
# Update the package list
sudo apt update
Step by step:
install -dcreates/etc/apt/keyringswith the correct permissions for the keycurl … gpg --dearmorfetches the signing key and stores it in APT’s keyring formatecho … teeadds the source line, withlsb_release -scinserting your Ubuntu codenameapt updaterefreshes the metadata so DuckDB can be installed
Step 2: Update the Package List
If you did not run the last command above, do so now:
sudo apt update
Step 3: Install DuckDB
Install the CLI through APT:
sudo apt install duckdb
APT resolves dependencies and installs the duckdb binary.
Step 4: Verify the Installation
Check the version:
duckdb --version
Expected output:
v1.1.3 19864453f7
Open the interactive shell against a temporary in-memory database by running it with no arguments:
duckdb
Leave the shell with .quit or ctrl-d.
Getting Started with DuckDB
DuckDB is a complete SQL environment in one binary. The following examples run inside its interactive shell.
Querying Files Straight Away
The quickest way to appreciate DuckDB is to query a data file without any setup:
-- Launch with: duckdb
-- Explore a CSV as if it were a table
SELECT * FROM read_csv_auto('orders.csv') LIMIT 5;
-- Aggregate directly from a Parquet file
SELECT country, sum(revenue) AS total
FROM 'orders.parquet'
GROUP BY country ORDER BY total DESC;
-- Scan an entire folder of Parquet files at once
SELECT count(*) FROM 'warehouse/*.parquet';
Column names and types are inferred automatically, so there is nothing to declare first.
The Shell and Dot-Commands
Statements end with a semicolon, while dot-commands configure the shell itself:
CREATE TABLE metrics (day DATE, visits INTEGER);
INSERT INTO metrics VALUES ('2026-08-01', 120), ('2026-08-02', 143);
SELECT day, visits FROM metrics ORDER BY day;
.mode box
.tables
.schema metrics
.help
.mode switches output style (box, csv, json, markdown), .tables lists tables, and .schema prints DDL.
Persistent Databases with .open
By default the shell runs in memory and forgets everything on exit. Attach a persistent file with .open:
-- Create or open a database file
.open metrics.duckdb
Or open it from the command line directly:
duckdb metrics.duckdb
Everything you create is then saved to metrics.duckdb for the next session.
Importing and Exporting
DuckDB reads and writes CSV, Parquet, and JSON, which makes it a fast format converter:
-- Materialise a CSV into a table
CREATE TABLE orders AS SELECT * FROM read_csv_auto('orders.csv');
-- Write a filtered result to Parquet
COPY (SELECT * FROM orders WHERE revenue > 1000)
TO 'top_orders.parquet' (FORMAT parquet);
Extensions for Remote Data
Extensions add capabilities on demand. The httpfs extension lets you query files over the network:
INSTALL httpfs;
LOAD httpfs;
SELECT count(*)
FROM 'https://example.com/data/events.parquet';
Other frequently used extensions include json, parquet, spatial, and fts.
Keeping DuckDB Updated
As a managed package, DuckDB updates with your routine maintenance:
sudo apt update && sudo apt upgrade
Each upgrade installs the newest packaged release automatically.
Other Tools from deb.griffo.io
The repository packages many other tools worth having on Ubuntu:
- yq — a portable YAML, JSON, and XML processor for config data
- Nushell — a shell built around structured, tabular data
- fzf — a fuzzy finder for selecting files and snippets
- just — a command runner for saving common analysis tasks
Troubleshooting
Package Not Found
If APT cannot find the duckdb package:
- Re-run
sudo apt updateto refresh the index - Confirm your Ubuntu release is supported (Jammy, Noble, or newer)
- Check the source list:
cat /etc/apt/sources.list.d/deb.griffo.io.list
GPG or Key Errors
If APT reports a signature or key problem, re-import the key:
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://deb.griffo.io/EA0F721D231FDD3A0A17B9AC7808B4DD62C41256.asc | sudo gpg --dearmor --yes -o /etc/apt/keyrings/deb.griffo.io.gpg
sudo apt update
Extension Download Fails
DuckDB fetches extensions on first use, so INSTALL httpfs; needs outbound HTTPS. Behind a proxy or on an offline machine it will fail; set your proxy variables before launching and confirm connectivity:
export HTTPS_PROXY=http://proxy.internal:3128
duckdb
You can inspect the state of extensions from SQL:
SELECT extension_name, installed, loaded FROM duckdb_extensions();
Uninstalling
To remove DuckDB:
sudo apt remove duckdb
To remove the repository as well:
sudo rm /etc/apt/sources.list.d/deb.griffo.io.list
sudo rm /etc/apt/keyrings/deb.griffo.io.gpg
sudo apt update
Any .duckdb files you created stay on disk until you remove them.
Conclusion
DuckDB delivers a powerful analytical SQL engine in a single, dependency-free binary that queries your data files where they live. Whether you are exploring a stray CSV, crunching a warehouse of Parquet, or converting formats in a pipeline, the DuckDB shell makes it fast and pleasant. On Ubuntu, the deb.griffo.io repository reduces installation to apt install duckdb and folds updates into your normal upgrades.
Install it, launch duckdb, and run a SELECT straight over one of your files. The moment an aggregation runs over a folder of Parquet with zero configuration, DuckDB earns a permanent place in your toolbox.
Resources
Disclaimer: The deb.griffo.io repository is an unofficial community project and is not affiliated with the official Debian or Ubuntu projects, or with the upstream DuckDB project.