Packages are reusable dbt projects you install as dependencies: macros, tests, and sometimes models (e.g. dbt_utils, dbt_expectations, auditor packages).
Declare them
packages.yml:
packages:
- package: dbt-labs/dbt_utils
version: [">=1.1.0", "<2.0.0"]Install them
dbt deps
This downloads packages into dbt_packages/ (historically dbt_modules/ in older versions).
Mental model
packages.yml → dbt deps → dbt_packages/
(macros/tests available to your project)Good practices
- Pin version ranges deliberately
- Commit
package-lock.ymlwhen your team uses it for reproducible installs - Run
dbt depsin CI beforedbt build - Prefer well-known packages over reinventing surrogate keys and date spines
Interview tip: "dbt deps is to dbt what npm install / pip install -r is to app dependencies."