Storage buckets: where uploaded files are kept
Describes PhoenixKit 3.6.1. On an older release? The version menu above has this guide as it was then.
A bucket is a place PhoenixKit can write files to: a folder on the server’s own disk, or a bucket on an S3-compatible storage service. Every upload is stored in one or more buckets, so a site needs at least one before anything can be uploaded.
Where to find it
Settings → Media, tab Buckets (/admin/settings/media). You need the Manage storage permission (a part of Media), or the Owner or Admin role.
Cloud buckets take their keys from an Object Storage (S3-compatible) integration, set up on Settings → Integrations, which needs the System Integrations permission.
Buckets: where files are stored.
The bucket list
Media Buckets lists every bucket with its Name (and where it points), Type, Used by (which storage profiles list it), Files, Objects, Size and Status (Enabled or Disabled). The name opens the bucket’s own page. The row menu has Details, Edit bucket, Disable or Enable, and Delete bucket.
Under the table:
- Total Buckets.
- Enabled, with how many are disabled.
- In a storage profile: buckets that no profile lists store and serve nothing.
With no bucket yet, the tab says No Media Buckets Configured and offers Create Your First Bucket.
A bucket made in an older version may keep its keys on the bucket itself (marked Keys on bucket). It keeps working; Move all to integrations moves the keys of every such bucket into integrations, where they can be rotated in one place.
Adding a bucket
Add Bucket opens Add Storage Bucket.
Basic Information
- Name: a name for this storage location inside PhoenixKit, not the bucket’s name on the service.
- Type: Local Filesystem or Cloud storage (S3-compatible).
Local Storage (for a local bucket)
- Storage Path: an absolute path, or one relative to the folder the application runs from, such as
priv/media. The form checks it as you type: it tells you where files will be stored, or that the path is a file, or that the application cannot write there. If the folder does not exist yet, saving asks whether to create it (Create Path).
Cloud storage (for a cloud bucket)
- Storage integration: one of your Object Storage connections. The keys, endpoint and service come from it. Add a connection opens a new integration in a new tab. With none yet, the form says No Object Storage connection exists yet.
- Region: asked only for Amazon S3.
- Bucket name on …: the bucket’s own name on the service, as its console shows it.
- Endpoint: asked only for a service without a fixed endpoint. Leave it empty for AWS S3; set it for MinIO, Wasabi, DigitalOcean Spaces and the like.
- Public URL (CDN): an address files are served from instead of the bucket’s own. For Cloudflare R2 this is the bucket’s r2.dev or custom domain; without one, files are served through your server.
- Test Connection: saves and removes a small file. It says The bucket can be read, written to and deleted from or Connection failed with the reason. The test is optional.
The services an integration can be: Amazon S3, Cloudflare R2, Backblaze B2, Hetzner Object Storage, Tigris, Wasabi, DigitalOcean Spaces, and Other S3-compatible (MinIO, Ceph, Garage, …).
Settings
- Access Type (cloud buckets): Public (direct URL), Signed (short-lived link) or Private (proxied): how visitors’ browsers get the files. A signed link lives 5 minutes, or 4 hours for audio and video, so a long video keeps playing and seeking. A proxied video or audio file is sent in parts as the browser asks for them, so it can start playing before it has all arrived.
- Size limit (MB): stop storing new files here once it holds this much. Empty means no limit.
- Enable bucket: only enabled buckets receive new uploads.
- Storage profile (new buckets only): None: just add the bucket, or a profile to join as a primary bucket. A bucket in no profile receives and serves nothing.
Save Bucket creates it. The message after saving says whether anything will be written to it yet.
Adding a bucket.
A bucket’s page
Click a bucket’s name to open its page (/admin/settings/media/buckets/<id>). It has Edit bucket, Disable or Enable, and Delete bucket at the top, and these sections:
- Overview: location, service, integration, access, maximum size, CDN, when it was created and updated.
- Used by: each storage profile that lists it, with the bucket’s role there (primary, replica or backup) and how many libraries use the profile. Add to profile adds it to one more. Roles, order and status are changed on the Storage profiles tab.
- Contents: Files, Objects and Size, how full it is against its size limit, free disk space for a local bucket, and a breakdown By library. Refresh counts again.
- Health: Test connection, the last result (Connection works or Connection failed), how many copies are stored here, being made, or failed, and when the copies were last verified.
- Log: what happened on this bucket, with filters Everything, Failures only and Damaged copies and repairs. How long entries are kept is set on Configuration.
- History: changes to the bucket’s settings.
Disabling and deleting
A disabled bucket is neither written to nor read from, whatever its storage profile says. Use it as an emergency stop.
A bucket that a storage profile lists cannot be disabled or deleted. The bucket’s edit page says This bucket is in use and links to the storage profiles. Take it out of those profiles first: set it to draining so its files move to the profile’s other buckets, then remove it.
A bucket that still holds files cannot be deleted either: disable it instead.
What it doesn’t do
- Placing files does not look at free space: when a profile has more buckets than copies to make, the order is the profile’s upload order, or a random turn.
- A bucket’s provider is fixed once it is created: the edit form shows the type but does not let you change it.