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

This page contains installation options for DuckDB. We recommend using the stable release, 1.0.0.

Binaries are available for major programming languages and platforms. If there are no pre-packaged binaries available, consider building DuckDB from source.

Version

  • 1.0.0 (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

Note: On Windows, the DuckDB Python package requires the Microsoft Visual C++ Redistributable.
install.packages("duckdb")

Note: On aarch64, if the DuckDB R package does not successfully compile, you may need to change your R environment's Make variables.
<dependency>
    <groupId>org.duckdb</groupId>
    <artifactId>duckdb_jdbc</artifactId>
    <version>1.0.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 v1.0.0
make -j8
git clone https://github.com/duckdb/duckdb.git
cd duckdb
make -j8
brew install duckdb

Note: DuckDB clients are installed without relying on any other DuckDB clients.
For example, the Python library can use a different version than the CLI client.
Therefore, they need to be updated separately.
DuckDB is currently not available via apt/yum.
Please use the following binary:
https://github.com/duckdb/duckdb/releases/download/v1.0.0/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/v1.0.0/duckdb_cli-linux-amd64.zip
winget install DuckDB.cli

Note: DuckDB clients are installed without relying on any other DuckDB clients.
For example, the Python library can use a different version than the CLI client.
Therefore, they need to be updated separately.
https://github.com/duckdb/duckdb/releases/download/v1.0.0/duckdb_odbc-linux-amd64.zip

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

sudo apt-get install unixodbc unixodbc-dev
./unixodbc_setup.sh --help
pip install duckdb --pre --upgrade

Note: On Windows, the DuckDB Python package requires the Microsoft Visual C++ Redistributable.
install.packages('duckdb', repos=c('https://duckdb.r-universe.dev', 'https://cloud.r-project.org'))


On aarch64, if the DuckDB R package does not successfully compile, you may need to change your R environment's make variables.
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>1.1.0-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-06-18