Skip to main content

Run your dbt projects

You can run your dbt projects locally or using the dbt platform with the dbt framework.

Common commands

In dbt, the commands you commonly use are:

  • dbt run — Run the models you defined in your project
  • dbt build — Build and test your selected resources such as models, seeds, snapshots, and tests
  • dbt test — Execute the tests you defined for your project

For all dbt commands and their arguments (flags), see the dbt command reference. To list all dbt commands from the command line, run dbt --help. To list a specific command's arguments, run dbt COMMAND_NAME --help.

 New to the command line?

If you're new to the command line:

  1. Open your computer's terminal application (such as Terminal or iTerm) to access the command line.
  2. Make sure you navigate to your dbt project directory before running any dbt commands.
  3. These terminal commands help you navigate your file system: cd (change directory), ls (list directory contents), and pwd (present working directory).

Where to run dbt

Use the dbt framework to quickly and collaboratively transform data and deploy analytics code following software engineering best practices like version control, modularity, portability, CI/CD, and documentation. This means anyone on the data team familiar with SQL can safely contribute to production-grade data pipelines.

The dbt framework is composed of a language and an engine:

  • The dbt language is the code you write in your dbt project — SQL select statements, Jinja templating, YAML configs, tests, and more. It's the standard for the data industry and the foundation of the dbt framework.

  • The dbt engine compiles your project, executes your transformation graph, and produces metadata. dbt supports two engines which you can use depending on your needs:

    • The dbt Core engine, which renders Jinja and runs your models.
    • The dbt Fusion engine, which goes beyond Jinja rendering to statically analyze your SQL — validating syntax and logic before your SQL is sent to the database (saving compute resources), and supports LSP features.

dbt platform

The dbt platform is a fully managed service that gives you a complete environment to build, test, deploy, and collaborate on dbt projects. You can develop in the browser or locally using the dbt Fusion engine or dbt Core engine.

For more details, see About dbt plans.

dbt local development

You can run dbt locally with the dbt Fusion engine or the dbt Core engine:

  • Install the dbt VS Code extension — Combines dbt Fusion engine performance with visual features like autocomplete, inline errors, and lineage. Includes LSP features and suitable for users with dbt platform projects or running dbt locally without a dbt platform project. Recommended for local development.
  • Install the Fusion CLIdbt Fusion engine from the command line, but doesn't include LSP features.
  • Install the dbt CLI — The dbt platform CLI, which allows you to run dbt commands against your dbt platform development environment from your local command line. Requires a dbt platform project.
  • Install dbt Core — The open-source, Python-based CLI that uses the dbt Core engine. Doesn't include LSP features.

Was this page helpful?

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

0
Loading