Skip to main content

Creating Dagster projects

The easiest way to start building a Dagster project is by using the create-dagster CLI. This CLI tool allows you to create a special type of Python package accessible to the Dagster webserver and UI.

Prerequisites
  • Python 3.10+
  • If using uv as your package manager, you will need to install uv (Recommended).
  • If using pip as your package manager, you will need to install the create-dagster CLI with Homebrew, curl, or pip.

For detailed instructions, see the Installation guide.

Step 1. Scaffold a new Dagster project

  1. Open your terminal and scaffold a new Dagster project. You can replace my-project with a different project name if you wish:

    uvx create-dagster@latest project my-project
  2. Respond y to the prompt to run uv sync after scaffolding

    Responding y to uv sync prompt

  3. Change to the project directory:

    cd my-project
  4. Activate the virtual environment:

source .venv/bin/activate

Your new Dagster project should have the following structure:

.
└── my-project
├── pyproject.toml
├── src
│   └── my_project
│   ├── __init__.py
│   ├── definitions.py
│   └── defs
│   └── __init__.py
├── tests
│   └── __init__.py
└── uv.lock
info

The create-dagster project command creates a directory with a standard Python package structure with some additions. For more information on the files and directories in a typical Dagster project, see the Dagster project file and directory reference.

Step 2. Add assets

Assets are the core abstraction in Dagster and can represent logical units of data such as tables, datasets, or machine learning models. Assets can have dependencies on other assets, forming the data lineage for your pipelines. To add assets to your project, see Defining assets.

Step 3: View assets in the UI

To start the Dagster UI, run:

dg dev

To see your assets, navigate to http://localhost:3000.

tip

See Running Dagster locally for more information on configuring and running your local Dagster instance, including creating a persistent instance and detecting when you're running locally to selectively run schedules or sensors depending on environment.

Step 4: Continue local development

You can specify new Python dependencies in pyproject.toml.

Step 5: Deploy your project to production (Optional)

  • OSS: Follow the steps in the OSS deployment docs to set up a production OSS deployment. You will need to add your project code to the Docker container used in the deployment.
  • Dagster+ Serverless or Hybrid: Follow the steps in Configuring CI/CD in Dagster+.