Skip to main content

DuckDB CLI

Installation

note

MotherDuck supports DuckDB 1.5.4. In US East (N. Virginia) - us-east-1, MotherDuck is compatible with client versions 1.4.0 through 1.5.4. In US West (Oregon) - us-west-2, MotherDuck supports client versions 1.4.1 through 1.5.4. In Europe (Frankfurt) - eu-central-1, MotherDuck supports client versions 1.4.1 through 1.5.4. In Europe (Dublin) - eu-west-1, MotherDuck supports client versions 1.4.1 through 1.5.4.

Download and install the DuckDB binary, depending on your operating system.

  1. Download the 64-bit Windows binary here
  2. Extract the zip file.

For more information, see the DuckDB installation documentation.

Try it

Walk through starting DuckDB, attaching MotherDuck, and running your first query in the playground below. Each step explains what happens before you press Enter, so you can preview the full flow before running it on your machine.

DuckDB CLI
MotherDuck DuckDB CLI emulator
Type duckdb to start a local DuckDB session in the browser. Then attach MotherDuck with ATTACH 'md:';.
$
Not started

Step by step

Start the DuckDB CLI

After installing, start DuckDB from your terminal:

duckdb

DuckDB opens an in-memory database by default, so any tables you create won't persist when you exit. Pass a filename to open or create a persistent local database:

duckdb mydatabase.duckdb

Connect to MotherDuck

From inside the DuckDB CLI, attach MotherDuck:

ATTACH 'md:';

DuckDB downloads the signed MotherDuck extension and opens your default browser to authenticate. Follow the instructions in the terminal.

To list your MotherDuck databases and confirm the connection, run:

SHOW DATABASES;

You can query local DuckDB data and MotherDuck databases from the same session.

For more on persisting your authentication credentials, see Authenticating to MotherDuck.

tip

You can also connect to MotherDuck directly when starting DuckDB:

duckdb "md:"
Manual extension update

When MotherDuck releases a new extension version you can force-reinstall the extension from the CLI.

FORCE INSTALL motherduck;

Open the MotherDuck UI from the CLI

Launch the MotherDuck UI from your terminal:

duckdb -ui

If you're already in a DuckDB session, run CALL start_ui(); instead.