Skip to main content

Creating a dbt project in a Dagster project

note

Using dbt Cloud? Check out the Dagster & dbt Cloud documentation.

In this tutorial, we'll walk you through integrating dbt with Dagster using a smaller version of dbt's example jaffle shop project, the dagster-dbt library, and a data warehouse, such as DuckDB.

By the end of this tutorial, you'll have your dbt models represented in Dagster along with other Dagster asset definitions upstream and downstream of them:

Asset group with dbt models and Python asset

To get there, you will:

Prerequisites​

To complete this tutorial, you'll need:

  • To have git installed. If it's not installed already (find out by typing git in your terminal), you can install it using the instructions on the git website.

  • To install dbt, Dagster, and the Dagster webserver/UI. Run the following to install everything using pip:

    uv add dagster-dbt dbt-duckdb

    The dagster-dbt library installs both dbt-core and dagster as dependencies. dbt-duckdb is installed as you'll be using DuckDB as a database during this tutorial. Refer to the dbt and Dagster installation docs for more info.

Ready to get started?​

When you've fulfilled all the prerequisites for the tutorial, you can get started by setting up the dbt project.