Skip to main content

Running Dagster locally

In this guide, we'll walk you through how to run Dagster on your local machine using the dagster dev command. The dagster dev command launches the Dagster UI and the Dagster daemon, allowing you to start a full deployment of Dagster from the command line.

warning

dagster dev is intended for local development only. If you want to run Dagster for production use cases, see our Deployment guides.

Locating your code

Before starting local development, you need to tell Dagster how to find the Python code containing your assets and jobs.

For a refresher on how to set up a Dagster project, follow our Recommended Dagster Project Structure guide.

Dagster can load Python modules as code locations.

my_module/__init__.py
Loading...

We can use the -m argument to supply the name of the module to start a Dagster instance loaded with our definitions:

dagster dev -m my_module

Creating a persistent instance

Running dagster dev without any additional configuration starts an ephemeral instance in a temporary directory. You may see log output indicating as such:

Using temporary directory /Users/rhendricks/tmpqs_fk8_5 for storage.

This indicates that any runs or materialized assets created during your session won't be persisted once the session ends.

To designate a more permanent home for your runs and assets, you can set the DAGSTER_HOME environment variable to a folder on your filesystem. Dagster will then use the specified folder for storage on all subsequent runs of dagster dev.

mkdir -p ~/.dagster_home
export DAGSTER_HOME=~/.dagster_home
dagster dev

Configuring your instance

To configure your Dagster instance, you can create a dagster.yaml file in your $DAGSTER_HOME folder.

For example, to have your local instance limit the number of concurrent runs, you could configure the following dagster.yaml:

~/.dagster_home/dagster.yaml
Loading...

For the full list of options that can be set in the dagster.yaml file, refer to the Dagster instance documentation.