This Craft CMS plugin seamlessly integrates with Bunny.net, providing three powerful filesystem drivers:
- Bunny Storage Filesystem – Upload assets directly from Craft’s control panel to your Bunny Storage Zone.
- Bunny CDN Filesystem – Offload image transformations to Bunny's Dynamic Image API, reducing load on your Craft CMS server.
- Bunny Stream Filesystem – Upload videos directly from Craft’s control panel to Bunny Stream.
Ideal for boosting performance and streamlining media delivery, this plugin makes it easy to manage and optimize your assets using Bunny.net’s infrastructure.
This plugin requires Craft CMS 5.8.0 or later, and PHP 8.2 or later.
You can install this plugin from the Plugin Store or with Composer.
Go to the Plugin Store in your project’s Control Panel and search for “Bunny.net”. Then press “Install”.
Open your terminal and run the following commands:
# go to the project directory
cd /path/to/my-project.test
# tell Composer to load the plugin
composer require thomasvantuycom/craft-bunny
# tell Craft to install the plugin
./craft plugin/install bunnyTo configure the Bunny Storage filesystem, you’ll need the following:
- Zone Name – The name of your Bunny.net storage zone.
- Primary Region – The main region where your storage zone is hosted.
- Access Key – This is not your general Bunny.net API key. Instead, it’s the password found under the "FTP & API Access" tab in your storage zone’s settings.
If you want assets in this filesystem to have publicly accessible URLs, you’ll also need to:
- Create a Pull Zone in your Bunny.net dashboard and link it to your Storage Zone.
- Provide the Pull Zone URL in the filesystem’s configuration under the appropriate setting.
The Bunny CDN filesystem is intended only for use as the Transform Filesystem of a volume. Its sole purpose is to offload image transformations to Bunny.net using their Dynamic Image API.
To use this filesystem:
- Create a Bunny Pull Zone and link it to either:
- A Bunny Storage Zone (as described above), or
- Any other Craft CMS filesystem that provides publicly accessible asset URLs.
- In your Pull Zone settings on Bunny.net:
- Enable the Optimizer feature.
- Specifically enable the Dynamic Image API.
This setup allows Craft to generate transformed images via Bunny’s edge network, significantly improving performance and reducing processing load on your server.
You can use Craft's standard image transformation syntax—no changes to your templates are needed. This plugin automatically maps Craft’s transformation parameters to Bunny.net’s Dynamic Image API behind the scenes.
Bunny currently supports the following Craft transformation modes:
- crop
- fit
Other modes are not supported and will be ignored.
The Bunny Stream filesystem is intended specifically for managing streaming videos. To configure the filesystem, you'll need the following:
- Library ID – The ID of your Bunny.net stream library.
- CDN Hostname – The hostname found under the "API" tab in your stream settings.
- Access Key – This is not your general Bunny.net API key. It is also found in the "API" tab.
Because Bunny Stream does not store original file extensions, you'll need to add the following to your general.php Craft config file for the filesystem to work:
->extraAllowedFileExtensions([''])Once configured, the Direct Play URL for a video will be available via the getUrl() method on your asset.