# dbt Cloud with the Postgres endpoint


> Connect dbt Cloud to MotherDuck natively through the Postgres endpoint, using dbt's built-in Postgres adapter and no self-hosted proxy.

You can connect [dbt Cloud](https://www.getdbt.com/product/dbt-cloud) to MotherDuck directly through the [Postgres endpoint](/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/), using dbt's built-in **Postgres** connection type (the `dbt-postgres` adapter). dbt Cloud talks to MotherDuck over the PostgreSQL wire protocol, so you do not need to stand up and operate your own `pg_duckdb` proxy.

:::note
This is the recommended way to use dbt Cloud with MotherDuck. If you specifically need to operate your own PostgreSQL server or proxy, see [dbt Cloud with MotherDuck via `pg_duckdb`](/integrations/transformation/dbt-cloud/) instead.
:::

## Before you start

You'll need:

- A MotherDuck account and a [read-write access token](/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck/#authentication-using-an-access-token).
- A target database in MotherDuck for dbt to build into.
- Your organization's regional Postgres endpoint hostname. Each MotherDuck region has its own endpoint, for example `pg.us-east-1-aws.motherduck.com`. You can find the exact connection details for your organization in the MotherDuck UI under **Settings → Postgres endpoint**.

## Configure the connection in dbt Cloud

In dbt Cloud, create a new connection and choose **Postgres** as the connection type, then enter the MotherDuck Postgres endpoint details:

| Field | Value |
|-------|-------|
| Host | Your regional endpoint, for example `pg.us-east-1-aws.motherduck.com` |
| Database name | The MotherDuck database dbt should build into, for example `my_db` |
| Port | `5432` |

Then fill out User/Deployment credentials using the connection created above:

| Field | Value |
| Username | `dbt` |
| Password | Your MotherDuck [access token](/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck/#authentication-using-an-access-token) |
| Schema | The schema dbt builds models into (set per developer and in your deployment environment) |
| Threads | Start with `4` |

Always connect over SSL. The endpoint's certificate is issued by [Let's Encrypt](https://letsencrypt.org/certs/isrgrootx1.pem), which is trusted by default in dbt Cloud.

## Key things to know

- **Write DuckDB SQL, not PostgreSQL SQL.** The Postgres endpoint speaks the Postgres wire protocol but runs DuckDB SQL underneath. Most models written for Postgres run unchanged because the dialects are close, but functions and types that differ between PostgreSQL and DuckDB follow [DuckDB's SQL](/sql-reference/) behavior.
- **Standard Postgres endpoint limitations apply.** DuckDB commands that depend on local files or extension management (for example, local-file `COPY`, `INSTALL`, `LOAD`) are not supported. See [Key things to know](/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/#key-things-to-know) on the Postgres endpoint page.
- **Choose the region that matches your organization.** The Postgres endpoint is regional, and an endpoint only serves organizations in its own region. Use the hostname for the region your MotherDuck organization is in.
- **Keep thread counts modest.** DuckDB will parallelize a single query as much as possible, so the gains from running more than one query at a time are minimal on the database side. That being said, our testing indicates that setting `threads: 4` typically leads to the best performance.

## See also

- [Connect via the Postgres endpoint](/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint/)
- [dbt Cloud with MotherDuck via `pg_duckdb`](/integrations/transformation/dbt-cloud/) (self-hosted proxy alternative)
- [dbt with DuckDB and MotherDuck](/integrations/transformation/dbt/)


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fintegrations%2Ftransformation%2Fdbt-cloud-postgres-endpoint%2F&page_title=dbt%20Cloud%20with%20the%20Postgres%20endpoint&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
