In this guide, we’ll show you how to set up a WordPress Amazon S3 integration, as well as how to use a content delivery network (CDN) in conjunction with it. This can help you save money on bandwidth, serve as a backup, and speed up your site.
Amazon S3 is a storage service that is one of Amazon Web Services’ many offerings. This is typically used for sites that require additional backups, such as those provided by our external backups add-on, or that serve huge files (downloads, software, videos, games, audio files, PDFs, etc.).
Amazon has a long history of being dependable, and its vast infrastructure allows it to provide extremely affordable storage charges. Netflix, Airbnb, SmugMug, Nasdaq, and other companies are among S3’s clients.
Amazon S3 (WordPress)
Because Amazon S3 is solely for bulk storage, you can nearly always expect it to be less expensive than your WordPress server. Offloading media to Amazon Web Services (AWS) can be a cost-effective strategy to save money, and it’s free for the first year (up to 5 GB storage). Additionally, because your media requests are served straight from Amazon, there is less burden on your WordPress site, resulting in speedier load times.
Not to be confused with Amazon CloudFront, Amazon S3 is a storage service provided by Amazon. S3 is a storage solution, whereas CloudFront is a CDN service. However, as we’ll see further down, they can also be used interchangeably.
WordPress Amazon S3 Setup
Important: WordPress, Amazon S3, and a CDN
We offer a one-click disk space add-on for Kinsta users who do not want to go through the process of setting up an external storage provider like Amazon S3.
Setup of Amazon S3 in WordPress
We propose using the WP Offload S3 Lite plugin, which was created by the talented team at Delicious Brains, for this connection. The basic version is available for free. As files are posted to the media library on your WordPress site, the plugin immediately uploads them to Amazon S3. After that, you can add a CDN, such as Amazon CloudFront, KeyCDN, or MaxCDN, as an optional setting.
S3 Lite WP Offload
This plugin is quite little, weighing in at only 204 KB. It now has over 30,000 active installs and a 4-star rating as of this writing. Take the actions outlined below.
Install the free WP Offload S3 Lite plugin next. You may get it from the WordPress repository or by searching for “wp offload s3” in the “Add New” plugins section of your WordPress dashboard. Activate it by clicking “Install Now.”
Install the WP Offload S3 Lite plugin.
Step 2: Install WP Offload S3 Lite
You may either follow Delicious Brains’ WordPress Amazon S3 documentation or we’ll walk you through the remainder in greater detail. Go to your Amazon Web Services account and sign in. If you don’t already have one, you can create one for free. You’ll need to create a new user after that. Choose a username and make sure “Programmatic access” is checked.
Add a user to Amazon Web Services
Step 3: Add a User to Amazon Web Services
Select “Attach existing policies directly” and then click “Create policy” to configure permissions for the user to manage files in S3. This link will open in a new tab. You’ll need to return to this once you’ve finished.
AWS Step 4: Permissions
Next to the option to create your own policy, click “Select.”
aws policy creation
Step 5: Create an AWS policy
After that, you must give your insurance a name and a description. This can be anything you want it to be. Then, in the “Policy Document” area, paste the following code.
“Version”: “2012-10-17”, “Statement”: [ “Effect”: “Allow”, “Action”: [ “s3:CreateBucket”, “s3:DeleteObject”, “s3:Put*”, “s3:Get*”, “s3:List*”, “s3:List*” ], “Resource”: [ “arn:aws:s3:::*” ], “Resource”: [ ”
The user can create buckets, remove files only (not buckets), upload files, download files, and list files and buckets with this policy. This is the most basic level of permissions that the plugins need to work.
However, for more information on extra bucket constraints, we recommend consulting Delicious Brain’s manual. For example, to lock it down, change the resource section above and add your bucket name (protesting is the name of our buck down in Step 11).