Start from scratch
This guide shows how to quickly start a new Workers Sites project from scratch.
- 
Ensure you have the latest version of git ↗ and Node.js ↗ installed. 
- 
In your terminal, clone the worker-sites-templatestarter repository. The following example creates a project calledmy-site:Terminal window git clone --depth=1 --branch=wrangler2 https://github.com/cloudflare/worker-sites-template my-site
- 
Run npm installto install all dependencies.
- 
You can preview your site by running the wrangler devcommand:Terminal window wrangler dev
- 
Deploy your site to Cloudflare: Terminal window npx wrangler deploy
The template project contains the following files and directories:
- public: The static assets for your project. By default it contains an- index.htmland a- favicon.ico.
- src: The Worker configured for serving your assets. You do not need to edit this but if you want to see how it works or add more functionality to your Worker, you can edit- src/index.ts.
- wrangler.jsonc: The file containing project configuration. The- bucketproperty tells Wrangler where to find the static assets (e.g.- site = { bucket = "./public" }).
- package.json/- package-lock.json: define the required Node.js dependencies.
- 
Change the nameproperty to the name of your project:{"name": "my-site"}name = "my-site"
- 
Consider updating compatibility_dateto today's date to get access to the most recent Workers features:{"compatibility_date": "yyyy-mm-dd"}compatibility_date = "yyyy-mm-dd"
- 
Deploy your site to a custom domain that you own and have already attached as a Cloudflare zone: {"route": "https://example.com/*"}route = "https://example.com/*"
Learn more about configuring your project.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark