Data location
Last updated Oct 2, 2026 Learn how the location of data stored in D1 is determined, including where the database runs and how you optimize that location based on your needs.
Automatic (recommended)
By default, D1 will automatically create your primary database instance in a location close to where you issued the request to create a database. In most cases this allows D1 to choose the optimal location for your database on your behalf.
Restrict database to a jurisdiction
Jurisdictions are used to create D1 databases that only run and store data within a region to help comply with data locality regulations such as the GDPR ↗︎ or FedRAMP ↗︎.
Workers may still access the database constrained to a jurisdiction from anywhere in the world. The jurisdiction constraint only controls where the database itself runs and persists data. Consider using Regional Services to control the regions from which Cloudflare responds to requests.
Note
Jurisdictions can only be set on database creation and cannot be added or updated after the database exists. If a jurisdiction and a location hint are both provided, the jurisdiction takes precedence and the location hint is ignored.
Supported jurisdictions
| Parameter | Location |
|---|---|
| eu | The European Union |
| fedramp | FedRAMP-compliant data centers |
| us | The United States |
Use the dashboard
- In the Cloudflare dashboard, go to the D1 SQL Database page. Go to D1 SQL database ↗
- Select Create Database.
- Under Data location, select Specify jurisdiction and choose a jurisdiction from the list.
- Select Create to create your database.
Use wrangler
npx wrangler@latest d1 create db-with-jurisdiction --jurisdiction=eu
Use REST API
curl -X POST "https://api.cloudflare.com/client/v4/accounts/<account_id>/d1/database" \
-H "Authorization: Bearer $TOKENn" \
-H "Content-Type: application/json" \
--data '{"name": "db-with-jurisdiction", "jurisdiction": "eu" }'
Provide a location hint
Location hint is an optional parameter you can provide to indicate your desired geographical location for your primary database instance.
You may want to explicitly provide a location hint in cases where the majority of your writes to a specific database come from a different location than where you are creating the database from. Location hints can be useful when:
- Working in a distributed team.
- Creating databases specific to users in specific locations.
- Using continuous deployment (CD) or Infrastructure as Code (IaC) systems to programmatically create your databases.
Provide a location hint when creating a D1 database when:
- Using
wrangler d1to create a database. - Creating a database via the Cloudflare dashboard ↗︎.
Caution
Providing a location hint does not guarantee that D1 runs in your preferred location. Instead, it will run in the nearest possible location (by latency) to your preference.
Use wrangler
Note
To install wrangler, the command-line interface for D1 and Workers, refer to Install and Update Wrangler.
To provide a location hint when creating a new database, pass the --location flag with a valid location hint:
wrangler d1 create new-database --location=weur
Use the dashboard
To provide a location hint when creating a database via the dashboard:
- In the Cloudflare dashboard, go to the D1 SQL Database page. Go to D1 SQL database ↗
- Select Create database.
- Provide a database name and an optional Location.
- Select Create to create your database.
Available location hints
D1 supports the following location hints:
| Hint | Hint description |
|---|---|
| wnam | Western North America |
| enam | Eastern North America |
| weur | Western Europe |
| eeur | Eastern Europe |
| apac | Asia-Pacific |
| oc | Oceania |
Caution
D1 location hints are not currently supported for South America (sam), Africa (afr), and the Middle East (me). D1 databases do not run in these locations.
Read replica locations
With read replication enabled, D1 creates and distributes read-only copies of the primary database instance around the world. This reduces the query latency for users located far away from the primary database instance.
When using D1 read replication, D1 automatically creates a read replica in every available region, including the region where the primary database instance is located.
If a jurisdiction is configured, read replicas are only created within the jurisdiction set on database creation.
Refer to D1 read replication for more information.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/d1/configuration/data-location/#page","headline":"Data location","description":"Control where D1 stores your data by setting location hints or jurisdiction constraints.","url":"https://developers.cloudflare.com/d1/configuration/data-location/","inLanguage":"en","image":"https://developers.cloudflare.com/d1/configuration/data-location/og.png?v=bfe8dffd2f550a89","dateModified":"2026-10-02","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Configure separate D1 databases for staging and production Wrangler environments. title: Environments image: https://developers.cloudflare.com/d1/configuration/environments/og.png?v=c0cb3fe5fbb0bbde
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/d1/llms.txt
Use this file to discover all available pages before exploring further.
Docs