Deploy your site
- Bunny CLI
- Manually
From your project root:
bunny sites create makes the storage zone and pull zone and links your directory to the site. bunny sites deploy --build detects your framework, runs its build with the package manager from your lockfile (Bun, pnpm, Yarn, or npm), and publishes the output directory. Each deploy is kept, so bunny sites deployments publish --previous rolls back to the last one.Run bunny sites ci init to add a GitHub Actions workflow that deploys on every push to main. See bunny sites for every command.Site configuration
When you deploy with the Bunny CLI and detection doesn’t fit your project, add asites block to bunny.jsonc at your project root. Every field is optional:
bunny.jsonc
bunny sites ci init reads the same file, so GitHub Actions builds and deploys what you deploy locally.
Framework guides
Each guide lists the build command and output directory, any config your framework needs for static output, and the steps for both the CLI and a manual deploy.JavaScript frameworks
Analog
Angular
Astro
Brunch
Ember
Next.js
Nuxt
Preact
Qwik
React
React Router
SolidStart
SvelteKit
Vite
Vue
Static site generators
Elder.js
Eleventy
Gatsby
Gridsome
Hexo
Hugo
Jekyll
Pelican
Zola
Documentation
Docusaurus
MkDocs
Sphinx
VitePress
Other
Blazor WebAssembly
Static HTML
Single-page apps
Single-page apps (React, Vue, Angular, and others) handle routing in the browser. When someone opens a deep link such as/dashboard or refreshes the page, the request has to return index.html so the router can take over.
The Bunny CLI sets this up for frameworks that build single-page apps, and asks when a build looks like one. For a manual deploy, configure your storage zone:
1
Open your storage zone
In the bunny.net dashboard, go to Storage and select your storage zone.
2
Open Error handling
Open the Error handling page.
3
Serve index.html for missing paths
Enter
/index.html in the 404 File path field, check Rewrite 404 to 200 status code, and click Save..js, .css, or images, still return a 404. See Storage zone settings for details.
Add a custom domain
With the Bunny CLI, add the domain to your site:CNAME record to create with your DNS provider. Once the record resolves, issue a free certificate with bunny sites domains ssl example.com.
For a manual deploy, add the hostname to your pull zone by following Custom hostnames.
Resize images with Bunny Optimizer
Bunny Optimizer resizes images at the edge from query parameters such as?width=640, so your build can ship one copy of each image.
bunny sites create leaves query strings and Optimizer off, so open the site’s pull zone under CDN → Pull Zones:
- Turn on URL Query String vary, so each
?width=gets its own cache entry. - Enable Bunny Optimizer, then turn on the Dynamic Image API and automatic WebP under Optimizer → Settings. Your build has already minified CSS and JavaScript, so turn Optimizer’s minification off.
srcset yourself:
Cache configuration
Static frontends benefit from long cache times on assets. Consider these settings in your pull zone:Build tools such as Vite add content hashes to filenames (for example,
main.a1b2c3.js), so these files are safe to cache indefinitely.