dbt deps is the dbt CLI command that downloads and updates the external packages declared in a project's packages.yml file.
dbt deps
Command?The dbt deps
command installs or updates all external dbt packages listed in packages.yml
into the project’s dbt_packages/
directory.
dbt deps
Matter in Analytics Engineering?Reliable package management guarantees reproducible builds, keeps macros in sync, and accelerates onboarding by automating dependency setup.
dbt deps
Work Internally?dbt reads packages.yml
, resolves Git, Hub, or local path sources, then downloads the version-pinned code to dbt_packages/
before compiling.
dbt deps
Create or Modify?The command creates dbt_packages/
and a lock file packages.lock
that stores exact commit SHAs for deterministic builds.
dbt deps
?Run it after cloning a repo, editing packages.yml
, bumping package versions, or during CI pipelines before dbt build
.
Use semantic version ranges like version: ">=1.4.0,<2.0.0"
or commit SHAs to avoid breaking changes.
Add an entry under packages:
in packages.yml
, then execute dbt deps
to fetch it immediately.
dbt deps
Flags?--target-path
changes the download directory; --profiles-dir
points to a custom profiles location; --fail-fast
stops on first error.
dbt deps
Integrate With CI/CD?Include dbt deps
in pipeline steps to guarantee dependencies exist before compilation and tests.
dbt deps
in Galaxy’s SQL Editor?Yes.Run dbt deps
in Galaxy’s built-in terminal or pre-commit hooks so collaborators always have synced macros when querying models.
dbt deps
Commit packages.lock
, pin major versions, audit packages for security, and rerun after changing branches.
Declare - package: dbt-labs/dbt_utils\n version: ">=1.1.0,<2.0.0"
then run dbt deps
; macros become available instantly for your team.
dbt deps
Errors?Enable verbose logs with -d
, clear dbt_packages/
, verify Git URLs, and check network proxies.
.
Dependency drift can break production models. Automating installs with dbt deps ensures every environment—local, CI, or Galaxy—uses identical vetted macros and packages, reducing runtime errors and onboarding time.
Not always. Run it after changing packages.yml, cloning a repo, or switching branches to ensure dependencies are current.
Yes. dbt resolves nested package requirements and records them in packages.lock for reproducibility.
Galaxy’s desktop IDE lets you execute dbt deps in an integrated terminal, share generated macros via Collections, and ensure endorsed SQL uses the same package versions.
Use --target-path ./custom_dir to place packages elsewhere, helpful for monorepos or disk-space constraints.