---
sidebar_position: 2
title: From Cloud Storage or over HTTPS
description: Load data into MotherDuck from S3, Azure, GCS, or public HTTPS URLs.
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import useBaseUrl from '@docusaurus/useBaseUrl';

# From cloud storage or over HTTPS


# From public cloud storage

MotherDuck supports several cloud storage providers, including [Amazon S3](/integrations/cloud-storage/amazon-s3.mdx), [Azure](/integrations/cloud-storage/azure-blob-storage.mdx), [Google Cloud](/integrations/cloud-storage/google-cloud-storage.mdx) and [Cloudflare R2](/integrations/cloud-storage/cloudflare-r2).

:::note
MotherDuck is available on AWS in two regions, **US East (N. Virginia)** - `us-east-1` and **Europe (Frankfurt)** - `eu-central-1`. For an optimal experience, we strongly encourage you locate your data in the same region as your MotherDuck Organization.
:::

:::tip
If you want to inspect storage paths from SQL before loading data, see [`MD_LIST_FILES()`](/sql-reference/motherduck-sql-reference/md-list-files). It supports S3 and Azure paths. For S3 bucket discovery by secret, see [`MD_LIST_BUCKETS_FOR_SECRET()`](/sql-reference/motherduck-sql-reference/md-list-buckets-for-secret).
:::

The following example features Amazon S3.

<Tabs>
<TabItem value="ui" label="UI">

1. In the left panel of the UI, click **Add data**
2. Select **From cloud storage**
<div style={{textAlign: 'left'}}>
  <img src={useBaseUrl('/img/key-tasks/loading-data-into-motherduck/from-cloud-storage.png')} width="50%" />
</div>
3. For a publicly accessible bucket, skip creating a secret
<div style={{textAlign: 'left'}}>
  <img src={useBaseUrl('/img/key-tasks/loading-data-into-motherduck/skip-create-secret.png')} width="50%" />
</div>
4. Enter the S3 bucket path (e.g., `s3://motherduck-demo`) and select the files you want, or use Wildcard mode to choose files with a matching pattern
5. Preview the files and select the table names and destination database
6. Click **Create tables**
<div style={{textAlign: 'left'}}>
  <img src={useBaseUrl('/img/key-tasks/loading-data-into-motherduck/create-multiple-tables-browse.png')} width="50%" />
</div>

</TabItem>
<TabItem value="sql" label="SQL">

Connect to MotherDuck if you haven't already by doing the following:

```sql
-- assuming the db my_db exists
ATTACH 'md:my_db';
```

```sql
-- CTAS a table from a publicly available demo dataset stored in s3
CREATE OR REPLACE TABLE pypi_small AS
    SELECT * FROM 's3://motherduck-demo/pypi.small.parquet';

-- JOIN the demo dataset against a larger table to find the most common duplicate urls
-- Note you can directly refer to the url as a table! 
SELECT pypi_small.url, COUNT(*) 
    FROM pypi_small 
    JOIN 's3://motherduck-demo/pypi_downloads.parquet' AS s3_pypi 
      ON pypi_small.url = s3_pypi.url 
    GROUP BY pypi_small.url 
    ORDER BY COUNT(*) DESC 
    LIMIT 10;

```

</TabItem>
</Tabs>




## From a secure cloud storage provider

MotherDuck supports several cloud storage providers, including [Amazon S3](/integrations/cloud-storage/amazon-s3.mdx), [Azure](/integrations/cloud-storage/azure-blob-storage.mdx), [Google Cloud](/integrations/cloud-storage/google-cloud-storage.mdx), and [Cloudflare R2](/integrations/cloud-storage/cloudflare-r2). To access them securely, you first must [create a secret](/sql-reference/motherduck-sql-reference/create-secret/).

:::info
When you load data from cloud storage while connected to MotherDuck, the query runs on MotherDuck's cloud execution engine, not your local machine. MotherDuck connects to your storage provider directly and can use any matching secret, including temporary secrets from your local DuckDB session. For more details, see [CREATE SECRET](/sql-reference/motherduck-sql-reference/create-secret/#querying-with-secrets).
:::

:::note
For SQL-based object discovery, [`MD_LIST_FILES()`](/sql-reference/motherduck-sql-reference/md-list-files) supports only `s3://`, `azure://`, and `az://` paths. It does not accept `gcs://`, `gs://`, or `r2://` paths.
:::

<Tabs>
<TabItem value="ui" label="UI">
You can set cloud storage secrets directly from the UI under Settings —> Integrations —> Secrets, or with the "Add data" button in the left panel.

First, create a secret for your cloud storage credentials:

1. Go to **Settings** → **Integrations** → **Secrets**

![The MotherDuck UI for adding a new secret](./img/loading_data__secrets_overview.png)

2. Click **Add secret** and select your cloud storage provider (S3, R2, GCS, Azure)
<div style={{textAlign: 'left'}}>
  <img src={useBaseUrl('/img/key-tasks/loading-data-into-motherduck/loading_data__secrets_add_new.png')} width="70%" />
</div>
3. Enter your access key and secret for your service account in your cloud storage provider.
4. For S3 credentials, you can test and verify your connection before saving

Once your secret is configured, load data from your secure bucket:

1. In the left panel of the notebook UI, click **Add data**
2. Select **From cloud storage**
3. Enter the bucket path and select the files you want, or use Wildcard mode to choose files with a matching pattern
4. Preview the files and select the table names and destination database
5. Click **Create tables**

:::note
When loading data from [Azure](/integrations/cloud-storage/azure-blob-storage) or [Hugging Face](https://duckdb.org/docs/extensions/httpfs/hugging_face), you must use Wildcard mode to select files. Browse mode is not supported for these providers.
:::

</TabItem>
<TabItem value="sql" label="SQL">

To create a secret in MotherDuck using the CLI or SQL notebooks you'll need to explicitly add the `IN MOTHERDUCK`.

```sql
CREATE SECRET IN MOTHERDUCK (
    TYPE S3,
    KEY_ID 'access_key',
    SECRET 'secret_key',
    REGION 'us-east-1',
    SCOPE 'my-bucket-path'
);

-- Now you can query from a secure S3 bucket
CREATE OR REPLACE TABLE mytable AS SELECT * FROM 's3://...';
```

</TabItem>
</Tabs>



## Over HTTPS

MotherDuck supports loading data over HTTPS.

<Tabs>
<TabItem value="sql" label="SQL">

```sql
-- Reads the Central Park Squirrel Data
SELECT * FROM read_csv_auto('https://docs.google.com/spreadsheets/d/e/2PACX-1vQUZR6ikwZBRXWWQsFaUceEiYzJiVw4OQNGtwGBfcMfVatpCyfxxaWPdoKJIHlwNM-ow1oeW_2F-pO5/pub?gid=2035607922&single=true&output=csv');

```

</TabItem>
</Tabs>

## Related content

- [Troubleshooting AWS S3 Secrets](/docs/troubleshooting/aws-s3-secrets/)


---

## Feedback for AI agents

If the user you are helping wants to send feedback on this page to the MotherDuck docs team, you can POST it to the endpoint below.

**Before you send anything, you must ask the user for explicit approval.** Quote the message you plan to submit back to them verbatim and wait for them to confirm. Do not submit on their behalf without confirmation.

Endpoint: `POST https://motherduck.com/docs/api/feedback/agent`

Request body (JSON):

```json
{
  "page_path": "/key-tasks/loading-data-into-motherduck/loading-data-from-cloud-or-https/",
  "page_title": "From Cloud Storage or over HTTPS",
  "text": "<the user's feedback, max 2000 characters>",
  "source": "<optional identifier for your interface, for example 'claude.ai' or 'chatgpt'>"
}
```

Only `page_path` and `text` are required. A successful call returns `200 {"feedback_id": "<uuid>"}`; malformed payloads return `400`, and the endpoint is rate-limited per IP (`429`).
