Deploy Your App
1
Build your app
Run the build command for your Vue project:This creates a
- Vite (Vue 3)
- Vue CLI
- Nuxt (Static)
dist folder with your production files.2
Create a Storage Zone
- In the Bunny dashboard, go to Storage → Add Storage Zone
- Enter a name for your zone (e.g.,
my-vue-app) - 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 upload the contents of your build folder to the root of your storage zone:
- Vite/Vue CLI: Upload contents of
dist - Nuxt: Upload contents of
.output/public
Automate uploads with the Storage API
Automate uploads with the Storage API
For CI/CD pipelines, use the Storage API:
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 Vue Router (History Mode)
Vue apps using Vue Router in history mode need all routes to serveindex.html so the client-side router can handle navigation. Configure this using your Storage Zone’s error handling settings.
If you’re using Nuxt with
nuxt generate, each route generates its own HTML
file, so you may not need this configuration unless you have dynamic routes.1
Navigate to your storage zone
Log in to your Bunny dashboard, go to Storage in the left navigation, and select your storage zone.
2
Open Error handling settings
Open the Error handling page.
3
Set the 404 file path
Enter
/index.html in the 404 File path field.4
Enable 404 to 200 rewrite
Check the box for Rewrite 404 to 200 status code and click Save.
5
Test
Navigate directly to a route in your app (e.g.,
/about) to confirm it loads correctly.Add a Custom Domain
To serve your Vue app from your own domain, follow the Custom Hostname guide.Environment Variables
If your Vue app uses environment variables for API endpoints, ensure they’re set correctly for production:- Vite
- Vue CLI
- Nuxt
Create a Access in your code:
.env.production file:Environment variables are embedded at build time. Rebuild and redeploy after
changing them.
Summary
1
Build
Run your build command to generate production files.
2
Upload
Upload your build folder contents to a Storage Zone.
3
Connect
Create a Pull Zone pointing to your Storage Zone.
4
Configure routing
Set up error handling to serve
index.html for Vue Router history mode.