Setting up dbt Cloud

Connect dbt Cloud to the warehouse created through Nexus, using a separate dbt connection, and run your first commands.

Learning Objectives

By the end of this lesson, you will be able to:

  • Create or join a dbt Cloud project
  • Connect to your existing BigQuery project using your organization’s dbt credentials
  • Use a managed Git repository when you don't have one yet
  • Navigate the dbt Cloud IDE
  • Run dbt debug, dbt run, and dbt build
  • Read run logs and view compiled SQL

Why dbt Cloud?

dbt Cloud provides a browser-based development environment with an editor, lineage, and run logs. This path assumes your organization can provide a dbt Cloud BigQuery connection. If you are setting up a personal course project, local dbt with OAuth is an option that does not require a service-account key.

Assignment: Set up your dbt Cloud environment

Step 1: Create or join a dbt Cloud account

Go to dbt Cloud, sign in or accept your organization's invitation, and choose a plan that supports your intended workflow. Check the current plan features before signing up.

Step 2: Have your BigQuery setup ready

Complete 1.2 Setting up BigQuery through the Nexus UI or MCP. Keep the actual generated project ID and location from the completed setup.

Nexus provisions ingestion access; it does not issue a JSON key for dbt Cloud. Your dbt administrator must provide a separate connection with permission to run jobs, read source data, and write your development models. dbt can create doe_family_dev if that identity has dataset creation permission; otherwise use a development dataset provided by your administrator.

Step 3: Connect your dbt Cloud project

Create or open your course project, then use your organization's BigQuery connection for the project created in Nexus. Configure your development dataset as doe_family_dev and match the warehouse's location.

If your organization has configured BigQuery OAuth, connect your Google account in your dbt developer credentials. BigQuery OAuth in dbt Cloud requires an Enterprise plan. Other accounts can use an administrator-provided service-account connection; this is separate from Nexus's ingestion identity. Follow dbt's BigQuery connection guide for the authentication options available to your account.

Test the connection before continuing. If you don't have a suitable dbt Cloud connection, use lesson 1.4 with local OAuth. Do not restart Nexus warehouse setup to resolve a dbt login problem.


Step 4: Set up a managed repository

If you don't have a Git host yet (or don't want to wire one up right now), dbt Cloud can host a managed repository for you.

  1. In the Set up a repository step, select Managed
  2. Name the repo doe-family-dbt
  3. Click Create

dbt Cloud will provision an empty Git repository owned by your account. You can build and deploy your project in it now, then export to GitHub later if you want to (we cover that in lesson 1.5).


Step 5: Initialize the project

  1. Click Initialize dbt Project — dbt scaffolds a working skeleton
  2. Click Commit and Sync to push the initial commit to your managed repo
  3. Open the Develop environment (the IDE)

Panel What it does
File explorer Browse models/, seeds/, macros/, dbt_project.yml
Editor Edit .sql and .yml files with syntax highlighting
Command bar Run dbt commands (dbt run, dbt build, etc.)
Lineage Visual DAG of your models
Compiled / Run View the SQL dbt sent to BigQuery and what came back

Running your first commands

In the command bar at the bottom of the IDE:

dbt debug

Tests your warehouse connection and shows your configuration:

dbt debug

Look for "All checks passed!" at the bottom. If you don't see it, the error message will tell you what's wrong (usually credentials or dataset permissions).

dbt run

Executes every model in your project. The starter project ships with two trivial examples — they'll materialize in your dev dataset:

dbt run

dbt test

Runs all tests defined in your project (uniqueness, not-null, custom).

dbt test

dbt build

Runs models and tests together, in dependency order. This is the command you'll use most:

dbt build

Running specific models

The -s (select) flag lets you target subsets:

dbt run -s my_model         # just one model
dbt run -s my_model+        # the model and everything downstream
dbt run -s +my_model        # the model and everything upstream
dbt run -s tag:nexus        # all models tagged 'nexus'

Viewing compiled SQL

dbt models are Jinja-templated. Before running, dbt compiles them into pure SQL. To see the compiled output:

  1. Click a model in the editor
  2. Open the Compiled tab — that's the SQL dbt sends to BigQuery

For example, a model that uses ref():

-- What you write
select * from {{ ref('stg_gmail_messages') }}
-- What BigQuery receives
select * from `doe-family-dwh`.`doe_family_dev`.`stg_gmail_messages`

The compiled view is the single most useful debugging tool in dbt.


Hands-On Exercise

  1. Run dbt debug and confirm all checks pass.

  2. Create a new file models/example/jane_says_hi.sql with:

    select 'Jane' as name, 'hello from BigQuery' as message
    
  3. Run it with dbt run -s jane_says_hi.

  4. Open the BigQuery console, navigate to your doe_family_dev dataset, and confirm the table exists and contains one row.

  5. Open the Compiled tab and compare what you wrote to what dbt actually sent BigQuery.


Summary

Concept Key takeaway
dbt Cloud setup Existing BigQuery project → separate dbt connection → repository
dbt authentication Separate from Nexus ingestion; use your organization’s configured connection
Managed repo Use when you don't have Git yet; export anytime
IDE layout File explorer, editor, command bar, lineage, compiled/run tabs
dbt build Runs models and tests together — your default command
Compiled SQL The pure SQL dbt sends to BigQuery; your debugging best friend

Next Lesson

If you'd also like to know what the local-dev path looks like, continue to 1.4 Setting up dbt locally with VS Code. Otherwise jump ahead to 1.5 Git and GitHub — yes, Cloud users need Git too.