Connect Vultr Object Storage to WordPress
To offload WordPress media to Vultr Object Storage, install Offloft, add an Object Storage subscription and a bucket, then copy the subscription keys into Offloft. These keys reach every bucket in the subscription, so keep this site separate. Offloft tests the connection and delivery before serving anything.
What you'll need
- A Vultr account
- A WordPress admin login
- Offloft installed (WordPress 6.5 or later and PHP 8.1 or later with the cURL extension)
- 1
Create the storage and the bucket
In the Vultr customer portal, go to Products > Cloud Storage > Object Storage and add an Object Storage subscription in the region closest to most of your visitors.
Open the subscription, go to the Buckets tab and select Create Bucket. Name: lowercase letters, numbers and hyphens.
In Offloft, enter the region part of the subscription's hostname, for example ewr1 for ewr1.vultrobjects.com.
Bucket namemy-site-media
- 2
Copy the access keys
Open the Object Storage subscription. Its Overview page shows the Hostname, the Access Key and the Secret Key; copy the two keys into Offloft.
These keys reach every bucket in the subscription. Keep a separate subscription for this site if you store other things in Vultr.
- 3
Let visitors read the files
Files are private unless each file is marked public. Offloft marks every file it uploads as public; the delivery check confirms it works.
If you prefer to make the whole bucket readable instead, apply the bucket policy below with s3cmd or the AWS CLI (put-bucket-policy). It lets anyone read a file whose address they know; nobody can list or change files.
Bucket policy{ "Version": "2012-10-17", "Statement": [ { "Sid": "PublicReadGetObject", "Effect": "Allow", "Principal": "*", "Action": ["s3:GetObject"], "Resource": ["arn:aws:s3:::my-site-media/*"] } ] } - 4
Serve files from your own domain with Vultr CDNOptional
In the portal, go to Products > CDN and add a Pull Zone. Use https://my-site-media.your-region.vultrobjects.com as the origin address.
Add media.yoursite.com as the zone's custom domain and, at your DNS provider, point it (CNAME) to the address Vultr shows for the zone.
In Offloft, use https://media.yoursite.com as the delivery address.
Origin addresshttps://my-site-media.your-region.vultrobjects.com
Delivery addresshttps://media.yoursite.com
- 5
Allow your site to read files (CORS)Optional
This step is optional. Images on your pages load without it. You need it only when your site's own scripts read files from storage, for example image editors, web fonts or 3D viewers. The rule below lets only your site read files, and only read them.
Vultr sets CORS through its S3 API. With the AWS CLI configured for these keys, run the command below.
AWS CLI commandaws s3api put-bucket-cors --bucket my-site-media --endpoint-url https://your-endpoint --cors-configuration '{"CORSRules":[{"AllowedOrigins":["https://yoursite.com"],"AllowedMethods":["GET","HEAD"],"AllowedHeaders":["*"],"MaxAgeSeconds":3600}]}' - 6
Run the connection test and the delivery check
In Offloft, paste your values and run the connection test. It checks your credentials, finds the bucket, uploads a test file, reads it back and deletes it. The delivery check then loads a small test image from your public address. Offloft serves nothing from the cloud until both pass.
Permissions Offloft needs
Vultr's keys reach every bucket in the subscription. Keep a separate subscription for this site if you store other things in Vultr.
Serving your files
Files are private unless each file is marked public, and Offloft marks every file it uploads. To use your own domain, add a Vultr CDN pull zone with the bucket as its origin. The delivery check confirms visitors can load files.
If the test fails
Next steps
Vultr questions
What do I enter as the region?
The region part of the subscription hostname, for example ewr1 for ewr1.vultrobjects.com.
Can I limit a key to one bucket?
Not with these keys. They reach every bucket in the subscription, so keep a separate subscription for this site if you store other things in Vultr.
How do I use my own domain?
With Vultr CDN: add a pull zone with the bucket as its origin, add your domain, and point it at the address Vultr shows.
Ready to connect your bucket?
Install Offloft free. Nothing moves until the connection test passes.