Deploy Your Site
1
Build your site
Run the Vite build command to generate your static files:This creates a
dist folder containing your production-ready site.2
Create a Storage Zone
- In the Bunny dashboard, go to Storage → Add Storage Zone
- Enter a name for your zone (e.g.,
my-vite-site) - Select a main storage region closest to your primary audience
- Click Add Storage Zone
Take note of your Storage Zone Password from the FTP & API Access section—you’ll need this for uploads.
3
Upload your files
Open your Storage Zone and use the built-in file manager to upload the contents of your
dist folder. Drag and drop all files and folders directly into the root of your storage zone.Automate uploads with the Storage API
Automate uploads with the Storage API
For automated deployments, use the Storage API to upload files programmatically:You can script this to upload all files in your
dist folder:4
Create a Pull Zone
- Go to CDN → Add Pull Zone
- Enter a name for your Pull Zone
- Set Origin Type to Storage Zone
- Select the Storage Zone you created earlier
- Click Add Pull Zone
https://your-pullzone-name.b-cdn.net.Configure for Single-Page Apps
If your Vite app uses client-side routing (React Router, Vue Router, etc.), you need to configure a fallback toindex.html.
1
Open Edge Rules
In your Pull Zone settings, go to Edge Rules → Add Edge Rule
2
Create the fallback rule
Configure the rule with:
| Setting | Value |
|---|---|
| Condition | If URL does not match (regex) |
| Pattern | \.(js|css|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf|eot|json|webp|avif)$ |
| Action | Override Origin URL |
| Value | /index.html |
3
Save and test
Click Save, then test by navigating directly to a route in your app (e.g.,
https://your-site.b-cdn.net/about).See the Frontend Deployment Overview for more
details on SPA routing configuration.
Add a Custom Domain
To serve your Vite site from your own domain, follow the Custom Hostname guide.Summary
1
Build
Run
npm run build to generate your dist folder.2
Upload
Upload your
dist contents to a Storage Zone.3
Connect
Create a Pull Zone pointing to your Storage Zone.
4
Configure
Add an Edge Rule for SPA routing if using client-side navigation.