Where Does DuckDB Store Databases and Config?
DuckDB database files live wherever you create them, with a .duckdbrc startup file in home for CLI defaults.
Last updated
DuckDB has no server data directory. Each database is a single .db file at whatever path you chose when you created it, which makes backup a plain file copy. In memory databases vanish when the process exits.
The CLI adds one home folder file: .duckdbrc runs at startup for prompt, mode, and pragma defaults. MotherDuck and other cloud attachments do not move local files. Check your app code for the connection path when hunting a missing database.
Where DuckDB stores this, by platform
~/.duckdbrc
CLI startup script, run automatically at launch. Database files themselves sit at user chosen paths ending in .db. Copy the .db file with all connections closed.
~/.duckdbrc
Same startup file on Mac. Homebrew installs do not relocate it. GUI clients ignore it and keep their own preferences elsewhere.
C:\Users\[username]\.duckdbrc
Startup file under your profile. Dotfile handling on Windows varies by tool, so confirm the CLI actually read it if defaults seem ignored.
Frequently asked questions
Where is my DuckDB database by default?
Nowhere by default. DuckDB creates the file at the path you pass on the command line or in your connection string. Use :memory: for throwaway work that should leave no trace.
How do I set DuckDB CLI defaults?
Put dot commands and settings in .duckdbrc in your home folder. The CLI runs it at startup like sqlite reads .sqliterc. Keep connection specific pragmas in project scripts instead.
Notice an outdated path? Let us know.