Setting up dbt Cloud
Creating a free dbt Cloud project, connecting it to BigQuery with a service account, and running your first commands.
Learning Objectives
By the end of this lesson, you will be able to:
- Create a free dbt Cloud account and project
- Connect dbt Cloud to BigQuery using a service account key
- Use a managed Git repository when you don't have one yet
- Navigate the dbt Cloud IDE
- Run
dbt debug,dbt run, anddbt build - Read run logs and view compiled SQL
Why dbt Cloud?
dbt Cloud is the easiest way to get dbt running:
- No local Python install
- A browser-based IDE with autocomplete, lineage, and docs
- Free Developer plan (one developer seat, unlimited models)
- Scheduled jobs and Git hosting included
If you want zero local setup, this is your path.
Assignment: Set up your dbt Cloud environment
Complete this assignment before continuing. You'll create a free dbt Cloud account, set up a managed repository, and connect to a BigQuery project.
Step 1: Create a free dbt Cloud account
- Go to cloud.getdbt.com and sign up
- Choose the Developer plan (free, no credit card required)
- Verify your email and finish account setup
Step 2: Have your BigQuery setup ready
This lesson assumes you've already completed 0.1 Setting up BigQuery:
- A GCP project (e.g.,
doe-family-dwh) with the BigQuery API enabled - A service account (
nexus-pipelineor similar) with BigQuery Job User, BigQuery Data Editor, and BigQuery Data Owner roles - The JSON key downloaded and saved somewhere safe outside any Git repo
dbt will create the doe_family_dev dataset on its first run — you
don't need to pre-create it.
If any of that isn't in place, complete Module 0 first and come back. You'll need the JSON key in the next step.
Step 3: Create a new dbt Cloud project
- In dbt Cloud, click Create Project
- Name it
doe-family(or whatever you prefer) - Continue to Connection — choose BigQuery
- Upload the JSON key you just downloaded; dbt Cloud will parse the credentials automatically
- Set the default development dataset to
doe_family_dev - Click Test Connection — you should see a success message
If the connection fails, double-check that the service account has the roles listed above and that the project ID in the JSON matches the project that owns your dataset.
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.
- In the Set up a repository step, select Managed
- Name the repo
doe-family-dbt - 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.4).
Step 5: Initialize the project
- Click Initialize dbt Project — dbt scaffolds a working skeleton
- Click Commit and Sync to push the initial commit to your managed repo
- Open the Develop environment (the IDE)
Navigating the dbt Cloud 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:
- Click a model in the editor
- 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
-
Run
dbt debugand confirm all checks pass. -
Create a new file
models/example/jane_says_hi.sqlwith:select 'Jane' as name, 'hello from BigQuery' as message -
Run it with
dbt run -s jane_says_hi. -
Open the BigQuery console, navigate to your
doe_family_devdataset, and confirm the table exists and contains one row. -
Open the Compiled tab and compare what you wrote to what dbt actually sent BigQuery.
Summary
| Concept | Key takeaway |
|---|---|
| dbt Cloud setup | Free Developer plan → BigQuery connection → managed repo |
| Service account | The credential dbt Cloud uses; grant BigQuery Job User + Data Editor |
| 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.