Set up your dbt kitchen in under 10 minutes
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.
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.
Mac: Terminal app. Windows: Command Prompt or PowerShell. Linux: any terminal. This is where you'll type commands.
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.
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.
Open your terminal and type this command:
python --version
Or on some systems (especially Mac):
python3 --version
You should see something like:
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.
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.
# 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!
(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.
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:
pip install dbt-snowflake
pip install dbt-bigquery
pip install dbt-redshift
pip install dbt-postgres
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!
Let's make sure dbt installed correctly. Type:
dbt --version
You should see something like this:
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.
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.
dbt init my_first_project
dbt will ask you a few questions:
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
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.
dbt Cloud will walk you through connecting to your warehouse. You'll need:
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.
$0/month
$100/seat/month
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.
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!
By default, dbt looks for this file at:
# 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.
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.
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
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
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).
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.
cd my_first_project
dbt debug — Check the ConnectionBefore cooking, let's make sure the stove actually turns on. dbt debug checks that dbt can connect to your warehouse.
dbt debug
If everything is configured correctly, you'll see a beautiful wall of green:
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! 🎉
dbt run — Cook Your First ModelsWhen you created the project with dbt init, dbt included two example models. Let's run them!
dbt run
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! 👨🍳💋
dbt test — Quality CheckNow let's taste-test the food. dbt test runs automated checks on your data to make sure nothing is broken.
dbt test
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
If you see green checkmarks and PASS on everything, you've successfully:
You are officially a dbt user. Welcome to the club! 🥳
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!
Let's make sure you've got the key concepts down! Answer these 3 questions:
What command do you use to check if dbt is installed correctly?
Where does the profiles.yml file live by default?
Why should you NEVER commit profiles.yml to Git?
pip install dbt-<adapter>.~/.dbt/profiles.yml and tells dbt how to connect to your warehouse.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!