Workers Sites configuration
Last updated Apr 23, 2026 Use Workers Static Assets Instead
You should use Workers Static Assets to host full-stack applications instead of Workers Sites. It has been deprecated in Wrangler v4, and the Cloudflare Vite plugin does not support Workers Sites. Do not use Workers Sites for new projects.
Workers Sites require the latest version of Wrangler ↗︎.
Wrangler configuration file
There are a few specific configuration settings for Workers Sites in your Wrangler file:
bucketrequired- The directory containing your static assets, path relative to your Wrangler configuration file. Example:
bucket = "./public". includeoptional- A list of gitignore-style patterns for files or directories in
bucketyou exclusively want to upload. Example:include = ["upload_dir"]. excludeoptional- A list of gitignore-style patterns for files or directories in
bucketyou want to exclude from uploads. Example:exclude = ["ignore_dir"].
To learn more about the optional include and exclude fields, refer to Ignoring subsets of static assets.
Note
If your project uses environments, make sure to place site above any environment-specific configuration blocks.
Example of a Wrangler configuration file:
{
"$schema": "./node_modules/wrangler/config-schema.json",
"name": "docs-site-blah",
"site": {
"bucket": "./public"
},
"env": {
"production": {
"name": "docs-site",
"route": "https://example.com/docs*"
},
"staging": {
"name": "docs-site-staging",
"route": "https://staging.example.com/docs*"
}
}
}
"$schema" = "./node_modules/wrangler/config-schema.json"
name = "docs-site-blah"
[site]
bucket = "./public"
[env.production]
name = "docs-site"
route = "https://example.com/docs*"
[env.staging]
name = "docs-site-staging"
route = "https://staging.example.com/docs*"
Storage limits
For very exceptionally large pages, Workers Sites might not work for you. There is a 25 MiB limit per page or file.
Ignoring subsets of static assets
Workers Sites require Wrangler ↗︎ - make sure to use the latest version.
There are cases where users may not want to upload certain static assets to their Workers Sites. In this case, Workers Sites can also be configured to ignore certain files or directories using logic similar to Cargo's optional include and exclude fields ↗︎.
This means that you should use gitignore semantics when declaring which directory entries to include or ignore in uploads.
Exclusively including files/directories
If you want to include only a certain set of files or directories in your bucket, you can add an include field to your [site] section of your Wrangler file:
{
"site": {
"bucket": "./public",
"include": [ // must be an array.
"included_dir"
]
}
}
[site]
bucket = "./public"
include = [ "included_dir" ]
Wrangler will only upload files or directories matching the patterns in the include array.
Excluding files/directories
If you want to exclude files or directories in your bucket, you can add an exclude field to your [site] section of your Wrangler file:
{
"site": {
"bucket": "./public",
"exclude": [ // must be an array.
"excluded_dir"
]
}
}
[site]
bucket = "./public"
exclude = [ "excluded_dir" ]
Wrangler will ignore files or directories matching the patterns in the exclude array when uploading assets to Workers KV.
Include > exclude
If you provide both include and exclude fields, the include field will be used and the exclude field will be ignored.
Default ignored entries
Wrangler will always ignore:
node_modules- Hidden files and directories
- Symlinks
More about include/exclude patterns
Learn more about the standard patterns used for include and exclude in the gitignore documentation ↗︎.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/workers/static-assets/#page","headline":"Workers Sites configuration","description":"Configure Workers Sites settings for static asset hosting in your Wrangler configuration file.","url":"https://developers.cloudflare.com/workers/static-assets/","inLanguage":"en","image":"https://developers.cloudflare.com/workers/configuration/sites/configuration/og.png?v=55c990b69546e989","dateModified":"2026-04-23","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: Deploy an existing static site project to Cloudflare using Workers Sites. title: Start from existing image: https://developers.cloudflare.com/workers/configuration/sites/start-from-existing/og.png?v=04d6cd6f62df986c
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/workers/llms.txt
Use this file to discover all available pages before exploring further.
Docs