> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getnao.io/llms.txt
> Use this file to discover all available pages before exploring further.

# dbt setup

nao is directly integrated with dbt.<br />
Set up your dbt connection to: preview dbt models, get lineage, give dbt tools to nao AI. <br />

Learn more about nao x dbt features: [Work with dbt](/nao-ide/features/work-with-dbt).

To configure dbt, open the "dbt configuration" panel.
It is available in the home page of nao, or at the left of the bottom bar.

<div style={{ textAlign: 'center' }}>
  <img src="https://mintcdn.com/naolabs/-ijk01sK8m8R-3il/images/get-started/dbt_setup.png?fit=max&auto=format&n=-ijk01sK8m8R-3il&q=85&s=c3a7f570ce956547512c60252c3a8242" alt="Launch dbt setup" width="800" data-path="images/get-started/dbt_setup.png" />
</div>

## dbt configuration panel

<div style={{ textAlign: 'center' }}>
  <img src="https://mintcdn.com/naolabs/-ijk01sK8m8R-3il/images/get-started/dbt_configuration.png?fit=max&auto=format&n=-ijk01sK8m8R-3il&q=85&s=53951f49e33e736d65665e39672d049e" alt="Configure dbt integration" width="800" data-path="images/get-started/dbt_configuration.png" />
</div>

<Steps>
  <Step title="Enable dbt">
    Activate dbt detection.
  </Step>

  <Step title="Pick a Python interpreter">
    Choose an existing interpreter / virtual environment or create a fresh virtual environment for the project.
  </Step>

  <Step title="Install packages">
    Select the dbt-core version and install any warehouse adapters (Snowflake, BigQuery, etc.) your project needs.
  </Step>

  <Step title="Point to project files">
    Set the folders that contain `dbt_project.yml` and `profiles.yml`. nao will try to find them automatically.
  </Step>

  <Step title="Add environment variables (optional)">
    Populate secrets or configs inline, or reference a `.nao.env` / `.env` file. Existing `.env` values are imported automatically.
  </Step>

  <Step title="Select the target">
    Pick the dbt target defined in `profiles.yml` (for example `dev`, `prod`). You can change it later on the bottom left bar.
  </Step>

  <Step title="Enable dbt defer (optional)">
    Enable the **dbt defer** toggle. Provide the production `manifest.json` you want to defer to.<br />
    When editing a dbt model, switch on **Defer mode** so previews fall back to production data when dev data is missing.<br />
    Read more about defer in the <a href="https://docs.getdbt.com/reference/node-selection/defer" target="_blank" rel="noreferrer">dbt docs</a>.
  </Step>
</Steps>

<Check>
  **Check dbt is setup properly**

  When your dbt project is configured correctly, you'll see a checkmark in the lower-left status bar. If it shows a cross instead, click the **dbt project** button to reopen the setup panel and fix any missing steps.
</Check>

## dbt integration requirements

* **dbt Core only**: nao currently supports dbt Core projects. If you're on dbt Cloud, run a dbt Core project locally to integrate with nao.
* **Local environment**: The dbt project must live on the same machine where nao runs; remote dbt environments are not supported.
