Overview
You can use this document to learn how to offload image and media files from a WordPress server to your object storage bucket.
With this workflow:
- There is no need to change the URLs to match the bucket's path.
- There is no need to manually recode and upload each individual URL.
To use this document, you must have the following information available:
Required information | Description |
The access key and secret key for object storage |
|
The bucket's region |
|
The StackPath edge address for the CDN site that uses object storage as the origin |
|
Review StackPath endpoint URLs
Each region has a separate endpoint URL. Based on your region, review the list of endpoint URLs:
- us-east
- s3.us-east.stackpathstorage.com or
- s3.stackpathstorage.com
- us-west
- s3.us-west.stackpathstorage.com
- eu-central-1
- s3.eu-central.stackpathstorage.com
Step 1: Install Media Cloud
- Access Media Cloud.
- In the left-side navigation menu, click (or hover over) Plugins, and then select Add New.
- Search for Media Cloud for Amazon S3, and click Install Now, and then click Activate.
Step 2: Configure Media Cloud Settings
- Open the Setup Wizard.
- Select S3 Compatible.
- Complete the missing fields, and then click Next.
- In Access Key and Secret, enter your object storage's keys.
- In Bucket, enter your bucket's name.
- In Region, select your bucket's region.
- In Custom Endpoint, enter the endpoint URL that includes your bucket's region.
- Follow the on-screen instructions to test and verify the settings.
- If there are any error messages, resolve the errors, and then perform a system check to verify your changes.
- Navigate to the CDN Settings section. Next to CDN Base URL, enter the StackPath edge address for the CDN site that uses object storage as the origin. This action will establish the connection between the CDN and your bucket, which will allow files from the bucket to be stored and served from cache.
Upload new images
You can use these instructions to upload new images to your bucket through Media Cloud.
- In Media Cloud, in the left-side navigation menu, click (or hover over) Media, and then click Add New, and then add your media to WordPress.
- Now, any new images that are added in this manner will be automatically uploaded to your bucket. To verify, in your Media Library, select the cloud icon next to an image, and then verify the URL.
Upload existing images
You can use these instructions to upload existing media from your WordPress instance within the Media Library to your bucket.
- In your WordPress admin panel, navigate to Media Cloud.
- In the left-side navigation menu, select Migrate to Cloud, and then click Import Uploads.
- Now, your images are stored in your bucket. To verify, in your Media Library, select the cloud icon next to an image, and then verify the URL.