Skip to main content

Dagster integration with dbt

In this example, you'll build a pipeline with Dagster that:

  • Initializes a Dagster dbt project with components
  • Builds dbt tests
  • Builds incremental models
  • Connects upstream and downstream assets across the project

Prerequisites

To follow the steps in this guide, you'll need:

  • Basic Python knowledge
  • Python 3.10+ installed on your system. Refer to the Installation guide for information.
  • Familiar with dbt and data transformation.

Step 1: Set up your Dagster environment

First, set up a new Dagster project.

  1. Clone the Dagster repo and navigate to the project:

    cd examples/docs_projects/project_dbt
  2. Install the required dependencies with uv:

    uv sync
  3. Activate the virtual environment:

    source .venv/bin/activate

  4. Ensure the following environments have been populated in your .env file. Start by copying the template:

    cp .env.example .env

    And then populate the fields.

Step 2: Launch the Dagster webserver

To make sure Dagster and its dependencies were installed correctly, navigate to the project root directory and start the Dagster webserver:

dg dev

Next steps

Continue this example with the ingestion step.