Install and pin third-party dbt packages from dbt Hub using packages.yml and dbt deps
domain: docs.getdbt.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Add a packages.yml (or dependencies.yml) file at the project root listing each package as package: <namespace>/<name> with a pinned version.
Run dbt deps to resolve and download the packages into the dbt_packages/ directory, generating a package-lock.yml that records exact resolved versions.
Reference package macros/models in the project (e.g. dbt_utils.star()) once the install completes.
Commit packages.yml and package-lock.yml to version control, but leave dbt_packages/ gitignored so CI reinstalls it fresh on every run.
Re-run dbt deps after bumping a version pin to confirm the lock file updates and no macro-signature breaking changes were introduced.
Known gotchas
dbt_packages/ is regenerated by dbt deps and should never be hand-edited; CI pipelines must run dbt deps before dbt run/build.
Pinning to a floating version range can silently pull in a new minor version with breaking macro changes; pin exact patch versions for reproducible builds.
package-lock.yml records commit SHAs for git-sourced packages; if it's deleted or out of sync, dbt deps can resolve a different version than what was tested.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?