From cloud storage or over HTTPS
From public cloud storage
MotherDuck supports several cloud storage providers, including Amazon S3, Azure, Google Cloud and Cloudflare R2.
MotherDuck is available on AWS in three regions: US East (N. Virginia) - us-east-1, US West (Oregon) - us-west-2, 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.
If you want to inspect storage paths from SQL before loading data, see MD_LIST_FILES(). It supports S3 and Azure paths. For S3 bucket discovery by secret, see MD_LIST_BUCKETS_FOR_SECRET().
The following example features Amazon S3.
- UI
- SQL
- In the left panel of the UI, click Add data
- Select From cloud storage

- For a publicly accessible bucket, skip creating a secret

- 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 - Preview the files and select the table names and destination database
- Click Create tables

Connect to MotherDuck if you haven't already by doing the following:
-- assuming the db my_db exists
ATTACH 'md:my_db';
-- 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;
From a secure cloud storage provider
MotherDuck supports several cloud storage providers, including Amazon S3, Azure, Google Cloud, and Cloudflare R2. To access them securely, you first must create a secret.
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.
For SQL-based object discovery, MD_LIST_FILES() supports only s3://, azure://, and az:// paths. It does not accept gcs://, gs://, or r2:// paths.
- UI
- SQL
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:
- Go to Settings → Integrations → Secrets

- Click Add secret and select your cloud storage provider (S3, R2, GCS, Azure)

- Enter your access key and secret for your service account in your cloud storage provider.
- For S3 credentials, you can test and verify your connection before saving
Once your secret is configured, load data from your secure bucket:
- In the left panel of the notebook UI, click Add data
- Select From cloud storage
- Enter the bucket path and select the files you want, or use Wildcard mode to choose files with a matching pattern
- Preview the files and select the table names and destination database
- Click Create tables
When loading data from Azure or Hugging Face, you must use Wildcard mode to select files. Browse mode is not supported for these providers.
To create a secret in MotherDuck using the CLI or SQL notebooks you'll need to explicitly add the IN MOTHERDUCK.
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://...';
Over HTTPS
MotherDuck supports loading data over HTTPS, including CSV exports from public Google Sheets.
- SQL
SELECT *
FROM read_csv(
'https://docs.google.com/spreadsheets/d/<sheet_id>/export?format=csv&gid=<tab_id>',
MD_RUN = REMOTE
);
For a full Google Sheets walkthrough, including private sheets with HTTP authentication, see the Google Sheets integration.