DuckDB CLI
Installation
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.
- Windows
- macOS
- Linux
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.