DuckDB CLI
Installation
MotherDuck supports DuckDB client versions 1.4.1 through 1.5.5 in all regions. For the range each region supports, see client version support.
Download and install the DuckDB binary, depending on your operating system.
- Windows
- macOS
- Linux
The recommended way to install the CLI is with the MotherDuck install script:
Install with PowerShell
powershell -c "irm https://install.motherduck.com | iex"
The script installs a MotherDuck-supported DuckDB version to %LOCALAPPDATA%\duckdb\cli, installs the motherduck extension, and can fetch and persist a MotherDuck token.
If your PowerShell execution policy blocks the command above, use the cmd.exe fallback:
curl -sfL -o install.bat https://install.motherduck.com/install.bat && install.bat
The cmd.exe script installs the windows-amd64 build only and cannot run the interactive token flow. On ARM64, or to use the token flow, use the PowerShell script.
Download the binary
To install manually instead:
- Download the 64-bit Windows binary duckdb_cli-windows-amd64.zip
- Extract the zip file.
The recommended way to install the CLI is with the MotherDuck install script:
Install with bash
curl -s https://install.motherduck.com | sh
The recommended way to install the CLI is with the MotherDuck install script:
Install with sh
curl -s https://install.motherduck.com | sh
The script detects your architecture, installs the matching linux-amd64 or linux-arm64 binary, and pins a MotherDuck-supported DuckDB version.
Download the binary
To install manually instead:
- Download the Linux binary:
- For 64-bit, download the binary duckdb_cli-linux-amd64.zip
- For arm64/aarch64, download the binary duckdb_cli-linux-aarch64.zip
- 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.
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.
You can also connect to MotherDuck directly when starting DuckDB:
duckdb "md:"
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.