LESSON 3 · BEGINNER

⚙️ Installing dbt — Let's Get Cooking!

Set up your dbt kitchen in under 10 minutes

🧑‍🍳 Before We Start

Before you can cook, you need a kitchen! You need a stove, some pots, a cutting board, and a clean counter. Setting up dbt is exactly like setting up a kitchen — we need a few things in place before we can start making delicious data dishes.

Don't worry — this is one of the easiest setups in the entire data engineering world. If you can install an app on your phone, you can install dbt. We'll go step by step, with screenshots of what you should see at every stage.

📋 What You Need (Prerequisites)

🐍

Python 3.8+

dbt is built with Python. You need Python 3.8 or higher installed on your computer. Don't worry — we'll show you how to check.

💻

A Terminal

Mac: Terminal app. Windows: Command Prompt or PowerShell. Linux: any terminal. This is where you'll type commands.

🏢

A Data Warehouse

Snowflake, BigQuery, Redshift, PostgreSQL — or DuckDB for free local practice with zero cloud accounts needed!

Beginner? Use DuckDB. It's a free, lightweight database that runs on your laptop — no cloud account, no credit card, no setup headaches. It's like having a mini kitchen right on your desk. We'll show you how to set it up in this lesson.

Think of it this way: Python is like electricity — your kitchen needs power to run the stove. The terminal is like the kitchen counter — it's where you do the actual work. And the data warehouse is like the fridge — it's where all your ingredients (data) are stored. dbt is the chef that ties it all together.

🖥️ Option A: dbt Core (Free, Open Source)

dbt Core is the free, open-source version of dbt. It runs from your terminal (command line). This is what most professionals use, and it's what we recommend for learning because you'll understand exactly what's happening under the hood.

dbt Core is like building your own kitchen at home. You pick the appliances, you arrange the counter, you control everything. It takes a few minutes to set up, but once it's done, you have full control and it's completely free forever.

📌 Step 1: Check Your Python Version

Open your terminal and type this command:

Terminal
python --version

Or on some systems (especially Mac):

Terminal
python3 --version

You should see something like:

Expected Output
Python 3.11.5

If you see a version lower than 3.8 (like Python 2.7 or Python 3.6), you need to upgrade. Visit python.org/downloads and grab the latest version. If you see "command not found," Python isn't installed yet — same fix, go download it.

📌 Step 2: Create a Virtual Environment

A virtual environment is like having a separate drawer for each cooking project. Your pasta tools don't mix with your baking tools. Your dbt project gets its own clean drawer where only dbt-related stuff lives. This way, nothing gets messy or conflicts with other Python projects on your computer.

Terminal — Create & activate virtual environment
# Navigate to where you want your project
cd ~/projects

# Create a virtual environment called "dbt-env"
python3 -m venv dbt-env

# Activate it (Mac/Linux)
source dbt-env/bin/activate

# Activate it (Windows)
dbt-env\Scripts\activate

Once activated, you'll see (dbt-env) at the beginning of your terminal prompt. That means you're inside the virtual environment — your separate drawer is open and ready!

What your terminal looks like after activation
(dbt-env) user@laptop ~/projects $

Every time you open a new terminal window and want to work on dbt, you'll need to activate the virtual environment again with source dbt-env/bin/activate. Think of it like opening that specific drawer before you start cooking.

📌 Step 3: Install dbt with Your Adapter

dbt needs an adapter — a plugin that tells it how to talk to your specific data warehouse. Think of adapters like power plug converters when you travel. A US plug doesn't fit a UK socket without an adapter. Similarly, dbt needs the right adapter to connect to Snowflake vs. BigQuery vs. PostgreSQL.

Pick the adapter that matches your data warehouse:

❄️

Snowflake

pip install dbt-snowflake
📊

BigQuery

pip install dbt-bigquery
🔴

Redshift

pip install dbt-redshift
🐘

PostgreSQL

pip install dbt-postgres
🦆

DuckDB

pip install dbt-duckdb

⭐ Best for beginners!

New to data engineering? Start with dbt-duckdb. DuckDB is a free, in-process database — no server to install, no cloud account to create, no credit card needed. It's like a portable mini-oven you can carry in your backpack. Perfect for learning!

The installation will download dbt and all its dependencies. This usually takes 1–3 minutes depending on your internet speed. You'll see a bunch of text scrolling by — that's normal!

📌 Step 4: Verify the Installation

Let's make sure dbt installed correctly. Type:

Terminal
dbt --version

You should see something like this:

Expected Output
Core:
  - installed: 1.9.0
  - latest:    1.9.0 - Up to date!

Plugins:
  - duckdb: 1.9.0 - Up to date!

Seeing that output is like turning on the stove for the first time and seeing the flame. It works! Your kitchen has power. Your dbt is installed and ready to cook data.

📌 Step 5: Initialize Your First Project

Now let's create your very first dbt project! This is like setting up the kitchen layout — where the pots go, where the spices are, where the recipes live.

Terminal
dbt init my_first_project

dbt will ask you a few questions:

Interactive prompts
Which database would you like to use?
[1] duckdb

Enter a number: 1

Profile my_first_project written to ~/.dbt/profiles.yml.
Your new dbt project "my_first_project" was created!

After this, you'll have a brand new folder called my_first_project with all the files dbt needs. We'll explore every file in the next lesson (Project Structure), but for now — congratulations, your kitchen is built!

The Complete Installation Flow

🐍
Check
Python
📦
Create
Venv
⬇️
pip install
dbt
Verify
Version
🎉
dbt init
Project!

☁️ Option B: dbt Cloud (Managed Service)

dbt Cloud is like a fully equipped cooking school — they provide the kitchen, the tools, and even help you follow the recipes. dbt Core is like setting up your own kitchen at home. Both make the same food; dbt Cloud just handles the setup for you.

If you don't want to install anything on your computer, dbt Cloud lets you write and run dbt models entirely in your web browser. It's great for teams and for people who prefer a visual interface.

📌 Step 1: Sign Up

🌐 Go to cloud.getdbt.com

  1. Click "Sign Up" (you can use your Google or GitHub account)
  2. Choose the Free Developer plan — it includes 1 developer seat, 1 project, and unlimited runs
  3. Verify your email address
  4. You're in! Welcome to dbt Cloud.

📌 Step 2: Connect Your Data Warehouse

dbt Cloud will walk you through connecting to your warehouse. You'll need:

🔑 Connection Details

  • Host / Account URL
  • Database name
  • Username & password (or OAuth)
  • Schema name

🔒 Security

  • dbt Cloud encrypts all credentials
  • Supports SSO and MFA
  • IP whitelisting available
  • SOC 2 Type II certified

📌 Step 3: Connect Your Git Repository

dbt Cloud integrates with GitHub, GitLab, or Azure DevOps. This means your dbt project lives in Git (version control), and dbt Cloud pulls the latest code every time it runs.

Think of Git as a recipe binder with a time machine. Every time you change a recipe, Git saves the old version. If the new recipe tastes terrible, you can go back to the version that worked. dbt Cloud connects to this binder automatically.

💰 Pricing Overview

🆓 Developer (Free)

  • 1 developer seat
  • 1 project
  • Unlimited runs
  • Web-based IDE
  • Job scheduling

$0/month

👥 Team

  • Multiple developer seats
  • Unlimited projects
  • CI/CD integration
  • Semantic Layer access
  • Priority support

$100/seat/month

🏢 Enterprise

  • Everything in Team
  • SSO / SAML
  • Audit logging
  • Custom SLAs
  • Dedicated support

Custom pricing

For this course, the free Developer plan is more than enough. You get a full web IDE, scheduling, and unlimited runs. You won't need to pay a single rupee/dollar to follow along.

🔗 Connecting to Your Warehouse (profiles.yml)

If you chose dbt Core, the most important configuration file you'll ever meet is profiles.yml. This file tells dbt where your data warehouse is and how to connect to it.

profiles.yml is like your kitchen's address book — it tells dbt where your warehouse lives and how to get in. Without it, dbt is like a delivery driver with no address — it has the food but doesn't know where to go!

📍 Where Does profiles.yml Live?

By default, dbt looks for this file at:

File location
# Mac / Linux
~/.dbt/profiles.yml

# Windows
C:\Users\YourName\.dbt\profiles.yml

When you ran dbt init, dbt created this file for you automatically. But you'll often need to edit it to match your warehouse credentials.

📄 Example: DuckDB (Simplest — Great for Beginners)

YAML — ~/.dbt/profiles.yml (DuckDB)
my_first_project:
  target: dev
  outputs:
    dev:
      type: duckdb
      path: my_first_project.duckdb

That's it! Two lines of config and DuckDB is ready. No passwords, no servers, no cloud accounts. This is why we love DuckDB for learning.

📄 Example: PostgreSQL

YAML — ~/.dbt/profiles.yml (PostgreSQL)
my_first_project:
  target: dev
  outputs:
    dev:
      type: postgres
      host: localhost
      user: your_username
      password: your_password
      port: 5432
      dbname: my_database
      schema: dbt_dev
      threads: 4

📄 Example: Snowflake

YAML — ~/.dbt/profiles.yml (Snowflake)
my_first_project:
  target: dev
  outputs:
    dev:
      type: snowflake
      account: xy12345.us-east-1
      user: your_username
      password: your_password
      role: TRANSFORMER
      database: ANALYTICS
      warehouse: TRANSFORMING
      schema: dbt_dev
      threads: 4

📄 Example: BigQuery

YAML — ~/.dbt/profiles.yml (BigQuery)
my_first_project:
  target: dev
  outputs:
    dev:
      type: bigquery
      method: oauth
      project: my-gcp-project-id
      dataset: dbt_dev
      threads: 4
      location: US

NEVER commit profiles.yml to Git! This file contains passwords and connection secrets. It's like leaving your house key under the doormat and posting a photo on Instagram. Always add profiles.yml to your .gitignore file. dbt does this by default, but double-check!

Think of profiles.yml like the WiFi password written on a sticky note in your kitchen. You need it to connect, but you'd never post it publicly. It stays private, on your machine, and never goes into the shared recipe book (Git).

🚀 Your First dbt Run — The Magic Moment

This is it. The moment you've been waiting for. Your kitchen is set up, your address book is configured, and it's time to cook your first dish.

Imagine you've just finished building your kitchen. The stove works, the fridge is plugged in, and you have a recipe book on the counter. Now you're going to cook your very first meal — just to make sure everything works. That's what we're about to do with dbt.

📌 Step 1: Navigate to Your Project

Terminal
cd my_first_project

📌 Step 2: Run dbt debug — Check the Connection

Before cooking, let's make sure the stove actually turns on. dbt debug checks that dbt can connect to your warehouse.

Terminal
dbt debug

If everything is configured correctly, you'll see a beautiful wall of green:

Expected Output (all green = success!)
Configuration:
  profiles.yml file [OK found and valid]
  dbt_project.yml file [OK found and valid]

Required dependencies:
  - git [OK found]

Connection:
  host: localhost
  port: 5432
  user: your_username
  database: my_database
  schema: dbt_dev
  Connection test: [OK connection ok]

All checks passed!

"All checks passed!" = Your kitchen is ready to cook! 🎉

📌 Step 3: Run dbt run — Cook Your First Models

When you created the project with dbt init, dbt included two example models. Let's run them!

Terminal
dbt run
Expected Output
Running with dbt=1.9.0
Found 2 models, 4 tests, 0 sources, 0 exposures

Concurrency: 4 threads (target='dev')

1 of 2 START sql table model dbt_dev.my_first_dbt_model ......... [RUN]
1 of 2 OK created sql table model dbt_dev.my_first_dbt_model ..... [SELECT 2]
2 of 2 START sql view model dbt_dev.my_second_dbt_model .......... [RUN]
2 of 2 OK created sql view model dbt_dev.my_second_dbt_model ..... [OK]

Finished running 2 models in 0.42s.

Completed successfully

Done. PASS=2 WARN=0 ERROR=0 SKIP=0 TOTAL=2

See those green PASS=2 and ERROR=0? That means both example models ran perfectly. It's like your first two dishes came out of the oven looking and tasting exactly right. Chef's kiss! 👨‍🍳💋

📌 Step 4: Run dbt test — Quality Check

Now let's taste-test the food. dbt test runs automated checks on your data to make sure nothing is broken.

Terminal
dbt test
Expected Output
Running with dbt=1.9.0
Found 2 models, 4 tests, 0 sources

Concurrency: 4 threads (target='dev')

1 of 4 START test not_null_my_first_dbt_model_id ................ [RUN]
1 of 4 PASS not_null_my_first_dbt_model_id ...................... [PASS]
2 of 4 START test unique_my_first_dbt_model_id .................. [RUN]
2 of 4 PASS unique_my_first_dbt_model_id ........................ [PASS]
3 of 4 START test not_null_my_second_dbt_model_id ............... [RUN]
3 of 4 PASS not_null_my_second_dbt_model_id ..................... [PASS]
4 of 4 START test unique_my_second_dbt_model_id ................. [RUN]
4 of 4 PASS unique_my_second_dbt_model_id ....................... [PASS]

Finished running 4 tests in 0.28s.

Completed successfully

Done. PASS=4 WARN=0 ERROR=0 SKIP=0 TOTAL=4

🎉 Congratulations! Your Kitchen is Ready!

If you see green checkmarks and PASS on everything, you've successfully:

  1. ✅ Installed dbt
  2. ✅ Connected to your data warehouse
  3. ✅ Run your first models
  4. ✅ Passed your first tests

You are officially a dbt user. Welcome to the club! 🥳

🔧 Common Installation Issues

Even the best chefs sometimes have a stove that won't light or a fridge that makes weird noises. Here are the most common problems people run into when installing dbt, and how to fix them:

Problem What You See How to Fix It
Python version too old ERROR: dbt requires Python >=3.8 Download the latest Python from python.org. On Mac, try brew install python3.
"command not found: dbt" zsh: command not found: dbt Make sure your virtual environment is activated. Run source dbt-env/bin/activate first.
Permission denied ERROR: Could not install packages due to an OSError: [Errno 13] Don't use sudo pip install. Instead, use a virtual environment (Step 2 above). If you must, try pip install --user dbt-core.
Connection refused Connection test: FAILED in dbt debug Check your profiles.yml — is the host, port, username, and password correct? Is the warehouse running? Can you connect with another tool (like psql or DBeaver)?
SSL certificate error SSL: CERTIFICATE_VERIFY_FAILED On Mac, run: /Applications/Python\ 3.x/Install\ Certificates.command. On other systems, try pip install --trusted-host pypi.org dbt-core.
pip not found command not found: pip Try pip3 instead of pip. Or ensure Python is in your PATH. On Mac: brew install python3.
Conflicting packages ERROR: Cannot install dbt-core and ... This is exactly why we use virtual environments! Create a fresh one and install dbt there. Your separate drawer keeps things clean.

Still stuck? The dbt community Slack (getdbt.slack.com) has 50,000+ members who love helping beginners. Post your error message in the #beginners channel and someone will usually respond within minutes. It's like having 50,000 sous-chefs on speed dial!

🧠 Test Your Knowledge

Let's make sure you've got the key concepts down! Answer these 3 questions:

Question 1 of 3

What command do you use to check if dbt is installed correctly?

Question 2 of 3

Where does the profiles.yml file live by default?

Question 3 of 3

Why should you NEVER commit profiles.yml to Git?

📋 Lesson Summary

  • dbt Core is free and open source — install with pip install dbt-<adapter>.
  • Virtual environments keep your dbt installation clean and isolated from other Python projects.
  • profiles.yml lives at ~/.dbt/profiles.yml and tells dbt how to connect to your warehouse.
  • dbt debug checks your connection; dbt run executes models; dbt test validates data.
  • NEVER commit profiles.yml to Git — it contains passwords!
  • DuckDB is the easiest adapter for beginners — no cloud account needed.
  • dbt Cloud pricing tiers and enterprise features.
  • Specific adapter installation quirks (BigQuery OAuth, Snowflake key-pair auth).
  • Advanced profiles.yml options (multiple targets, environment variables).
  • SSL certificate troubleshooting details.

Quick challenge: Open your terminal right now and try installing dbt with DuckDB. Can you get from zero to dbt debug — All checks passed! in under 10 minutes? Time yourself and see!

{PW}