dbt_cloud.yml file
The dbt_cloud.yml file stores the credentials that dbt tools — like the dbt CLI, the dbt VS Code extension, and more — use to authenticate with dbt platform. You can download it from dbt platform and save it locally to your .dbt directory.
This page covers:
- How to download it and set up the
.dbtdirectory for the dbt CLI or the VS Code extension - The file structure and field reference
- The companion
dbt-cloudblock indbt_project.yml
The dbt_cloud.yml file contains API keys. Store it securely and make sure you do not commit it to version control.
Download dbt_cloud.yml
How you download the file depends on whether you're configuring the dbt CLI or the dbt VS Code extension.
- In dbt platform, select the project you want to work on. The project must already have a development environment set up.
- Go to Account settings → Your profile, then follow the steps for your tool:
- dbt CLI: Navigate to CLI → Configure Cloud authentication and click Download CLI configuration file.
- dbt VS Code extension: Navigate to VS Code Extension → Set up your credentials and click Download credentials.
The downloaded
dbt_cloud.ymlincludes your Personal access token (PAT).
-
Move the file to your
.dbtdirectory. If you don't have one yet, try one of these quick setup (one command) options:- Mac / Linux
- Windows
mkdir -p ~/.dbt && mv ~/Downloads/dbt_cloud.yml ~/.dbt/dbt_cloud.ymlmkdir %USERPROFILE%\.dbt 2>nul & move %USERPROFILE%\Downloads\dbt_cloud.yml %USERPROFILE%\.dbt\dbt_cloud.ymlIf your downloaded file has a numerical suffix (for example,
dbt_cloud(2).yml), rename it todbt_cloud.ymlbefore moving it. The dbt CLI and extension only look for the exact filename. -
Confirm that the
project-idin yourdbt_project.ymldbt-cloudblock matches the project you're working on. This registers and connects your tool to dbt platform and enables platform features such as Mesh and deferral.
File structure
Your dbt_cloud.yml file has the following structure:
version: "1"
context:
active-host: your_active_host # for example, "abc123.us1.dbt.com"
active-project: your_project_id # for example, "123456"
projects:
- project-name: your_project_name
project-id: your_project_id
account-name: your_account_name
account-id: your_account_id
account-host: your_account_host # for example, "abc123.us1.dbt.com"
token-name: your_token_name # for example, "cloud-cli-1234"
token-value: your_token_value
- project-name: your_project_name
project-id: your_project_id
account-name: your_account_name
account-id: your_account_id
account-host: your_account_host
token-name: your_token_name
token-value: your_token_value
For example, if I had a Jaffle and wizard shop account, here's what my dbt_cloud.yml file would look like:
version: "1"
context:
active-host: "abc123.us1.dbt.com"
active-project: "123456"
projects:
- project-name: "Project 1"
project-id: "123"
account-name: "Jaffle and wizard shop"
account-id: "1"
account-host: "abc123.us1.dbt.com"
token-name: "cloud-cli-1091"
token-value: "dbtu_token_value" # this would be a longer token value
- project-name: "Project 2"
project-id: "456"
account-name: "Jaffle and wizard shop"
account-id: "1"
account-host: "abc123.us1.dbt.com"
token-name: "cloud-cli-1091"
token-value: "dbtu_token_value"
- project-name: "Project 3"
project-id: "789"
account-name: "Jaffle and wizard shop"
account-id: "1"
account-host: "abc123.us1.dbt.com"
token-name: "cloud-cli-1091"
token-value: "dbtu_token_value"
Field reference
| Loading table... |
The dbt-cloud block in dbt_project.yml
The dbt-cloud block is a companion config that lives in your project's dbt_project.yml file (not in dbt_cloud.yml). It tells the dbt CLI, the Studio IDE, and Fusion which dbt platform project your local project corresponds to.
name:
version:
# Your project configs...
dbt-cloud:
project-id: your_project_id
defer-env-id: '123456' # optional
| Loading table... |
Related docs
Was this page helpful?
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.