Search Shortcut cmd + k | ctrl + k
Search cmd+k ctrl+k
0.10 (stable)
DuckDB Installation

This page contains installation options for DuckDB:

  • Binaries are available for major programming languages and platforms
  • We recommend using the stable release, currently 0.10.1
  • If there are no pre-packaged binaries for a platform, consider building DuckDB from source

Version

  • 0.10.1 (stable release)
  • Nightly build (bleeding edge)

Environment

  • Command line
  • Python
  • R
  • Java
  • Node.js
  • Rust
  • Go
  • C/C++
  • ODBC

Platform

  • Windows
  • macOS
  • Linux

Download method

  • Package manager
  • Direct download

Architecture

  • x86_64
  • arm64

Installation

This section is intentionally left blank

Usage example

import duckdb
cursor = duckdb.connect()
print(cursor.execute('SELECT 42').fetchall())
pip install duckdb --upgrade
install.packages("duckdb")
<dependency>
    <groupId>org.duckdb</groupId>
    <artifactId>duckdb_jdbc</artifactId>
    <version>0.10.0</version>
</dependency>
npm install duckdb
cargo add duckdb --features bundled
go get github.com/marcboeker/go-duckdb
git clone https://github.com/duckdb/duckdb.git
cd duckdb
git checkout v0.10.1
make -j8
git clone https://github.com/duckdb/duckdb.git
cd duckdb
make -j8
brew install duckdb
DuckDB is currently not available via apt/yum.
Please use the following binary:
https://github.com/duckdb/duckdb/releases/download/v0.10.1/duckdb_cli-linux-aarch64.zip
DuckDB is currently not available via apt/yum.
Please use the following binary:
https://github.com/duckdb/duckdb/releases/download/v0.10.1/duckdb_cli-linux-amd64.zip
winget install DuckDB.cli
https://github.com/duckdb/duckdb/releases/download/v0.10.1/duckdb_odbc-linux-amd64.zip

sudo apt-get install unixodbc unixodbc-dev
./unixodbc_setup.sh --help
https://github.com/duckdb/duckdb/releases/download/v0.10.1/duckdb_odbc-linux-aarch64.zip

sudo apt-get install unixodbc unixodbc-dev
./unixodbc_setup.sh --help
pip install duckdb --pre --upgrade
install.packages('duckdb', repos=c('https://duckdb.r-universe.dev', 'https://cloud.r-project.org'))
Nightly Java builds are available in the Sonatype snapshots repository, which can be accessed as follows:
<dependency>
    <groupId>org.duckdb</groupId>
    <artifactId>duckdb_jdbc</artifactId>
    <version>0.10.1-SNAPSHOT</version>
</dependency>

...

<repositories>
    <repository>
        <id>oss-sonatype</id>
        <name>oss-sonatype</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>
		
npm install duckdb@next
Currently not available
import duckdb
cursor = duckdb.connect()
print(cursor.execute('SELECT 42').fetchall())
library("DBI")
con = dbConnect(duckdb::duckdb(), ":memory:")
dbWriteTable(con, "iris", iris)
dbGetQuery(con, 'SELECT "Species", MIN("Sepal.Width") FROM iris GROUP BY "Species"')
Class.forName("org.duckdb.DuckDBDriver");
Connection conn = DriverManager.getConnection("jdbc:duckdb:");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT 42");
var duckdb = require('duckdb');
var db = new duckdb.Database(':memory:'); // or a file name for a persistent DB
db.all('SELECT 42 AS fortytwo', function(err, res) {
  if (err) {
    console.warn(err);
    return;
  }
  console.log(res[0].fortytwo)
});
use duckdb::{Connection, Result};

#[derive(Debug)]
struct Person { id: i32, name: String, }

fn main() -> Result<()> {
    let conn = Connection::open_in_memory()?;

    conn.execute_batch(
        r"CREATE TABLE person (id BIGINT, name VARCHAR);
          INSERT INTO person VALUES (42, 'John');
        ")?;
    let mut stmt = conn.prepare("SELECT id, name FROM person")?;
    let person_iter = stmt.query_map([], |row| {
        Ok(Person {id: row.get(0)?, name: row.get(1)?})
    })?;

    for person in person_iter {
        println!("Found person {:?}", person.unwrap());
    }
    Ok(())
}
package main

import (
	"database/sql"
	"fmt"
	_ "github.com/marcboeker/go-duckdb"
)

func main() {
	db, _ := sql.Open("duckdb", "")

	db.Exec(`CREATE TABLE person (id INTEGER, name VARCHAR)`)
	db.Exec(`INSERT INTO person VALUES (42, 'John')`)

	var (
		id   int
		name string
	)
	row := db.QueryRow(`SELECT id, name FROM person`)
	_ = row.Scan(&id, &name)
	fmt.Println("id:", id, "name:", name)
}
DuckDB db(nullptr);
Connection con(db);
auto result = con.Query("SELECT 42");
result->Print();
./duckdb
About this page

Last modified: 2024-03-28