Connect to MotherDuck
Securely connect your Hex workspace to your MotherDuck database.
- Users need the Admin workspace role to create a shared workspace data connection.
- Users need Can Edit or higher project permissions to create project data connections.
MotherDuck is a serverless analytics platform built on DuckDB. It combines DuckDB's exceptional speed for analytical queries with cloud-based storage and compute, allowing you to run analytics on data in cloud object storage (S3, GCS) or MotherDuck's managed storage. The key advantage is inheriting DuckDB's performance and rich SQL features while adding collaboration capabilities and automatic scaling without managing infrastructure.
MotherDuck is ideal for ad-hoc analysis and data exploration on moderately sized datasets (up to several terabytes) at lower cost than traditional cloud warehouses. It's best suited for analytical workloads, not high-concurrency transactions or real-time data ingestion at scale.
How to get set up
- Create a free MotherDuck account if you don't already have one.
- Generate a MotherDuck access token (instructions to generate).
- In Hex, go to Settings → Data sources.
- Click + Connection, select MotherDuck, and fill out the fields below.
Basic settings
- Name and Description - Set a display name and optional description to help identify your data connection.
- MotherDuck Token - Your MotherDuck access token (instructions to generate).
- Default database (optional) - This allows you to query schemas and tables from Hex without needing to type the default database name in your SQL query.

Additional settings
The data connection form includes several optional sections:
- Advanced - Optional settings like custom SQL formatting, including schema data for AI, and connecting via SSH.
- Access - Optional data connection permissions.
- Schema browsing - Recommended settings like scheduling schema browser refreshes and schema filtering, both of which are recommended for performance and AI agent accuracy.
If you use a firewall to restrict database access, you'll need to add Hex's IP addresses to your allowlist.