Using Amazon S3
This section covers how to set up and use Amazon S3 to store, manage, and serve content remotely on your website.
Amazon S3 is an affordable and almost limitless cloud storage solution that lets you store your files and large amounts of data, including images, media files, and website backups securely and embed these in your web content.
In this lesson, we provide an overview of the Amazon S3 service, show you how to set up an Amazon S3 account for your business, and how to upload files to S3 directories.
Why Store Your Site’s Content In The Cloud?
Hosting and streaming large media files on your website (e.g. videos) can be expensive and sometimes even complicated.
When it comes to storing files to be used as content on your website, you have a number of options.
While the WordPress Media Library is a great tool for storing media files used in your content, these files are stored on your own server, and depending on your web hosting setup, these can take up excessive space and cause issues with site performance, or exceed your data or bandwidth allowance.
Another option is to upload and stream videos from a free video hosting site like YouTube, display images stored on Flickr, etc., and embed these into your content.
The problem with storing your web content files on free sites, however, is that you are not in control of your content. If, for example, the site changes its policies, this could have a significant effect on how your site can access your files and potentially even disrupt your entire business.
Given the above options and their respective challenges, a viable alternative is to serve content on your site that is stored and streamed from the cloud.
Many companies offer inexpensive cloud storage solutions that allow you to host and embed media, files, and documents into your website content.
Enter Amazon S3…
What Is Amazon S3?
Amazon Simple Storage Service (Amazon S3) is an affordable, secure, and reliable cloud storage solution service from Amazon Web Services (AWS) that you can use to store and retrieve any amount of data, at any time, from anywhere on the web.
Amazon S3 lets you share, distribute and download zip, PDF, audio, and video files, and stream videos on your site without consuming a large amount of bandwidth or straining your server’s resources.
Essentially, you’re using Amazon’s servers to store as much information as you want (videos, audio files, images, large files, etc.) at very little cost (you’ll pay only a few dollars per month for large amounts of data use), making this an ideal solution for using media content on your website.
The video below provides an overview of the Amazon S3 service:
Note: Amazon S3 is one of several applications that Amazon offers in its stable of products, so it’s important not to confuse Amazon S3 with Amazon AWS (i.e. the entire suite of services).
Benefits Of Using Amazon S3
Amazon S3 helps to address some of the biggest technical challenges many businesses face managing content on their websites, like site speed, security, and bandwidth cost.
Here are some of the benefits of using Amazon S3 to host your site’s content:
Improve Site Speed
When you host images, videos, and other heavy bandwidth items like large downloadable files on your own server, the more simultaneous traffic you have (i.e. many users visiting your site at the same time), the slower your pages load on your visitors’ browsers.
If you have spikes in traffic, this extra load can even crash your site.
One of the benefits of storing content remotely on the cloud is that uploading images, videos, and other large bandwidth-consuming files to Amazon S3 instead of your own server allows thousands of visitors to access your information without slowing down your site because the files are being delivered from Amazon’s servers, not yours.
Storing large-sized files or a large number of files in the cloud and streaming these in your content remotely can help to improve your site’s performance.
Host Large-Sized Files
Imagine having a product launch where lots of customers try to download a number of large zip files hosted on your server. Your server could crash, support tickets would start piling up and what should be a very happy day would quickly turn into a nightmare.
If you host your images, videos, and other downloadable files on Amazon S3, your visitors will not experience your site slowing down, buffering, or crashing due to excessive bandwidth consumption.
You could have 100, 1,000, or 10,000 people downloading your zip files simultaneously without any problems.
Save Money Streaming Your Content
Another benefit of using Amazon S3 is how much money you can save. Amazon S3 is an “online scalable (simple) storage service,” which means that it’s essentially a hard drive in cyberspace with unlimited storage – you only pay for what you use.
When Amazon launched S3 back in 2006 (2007 in Europe) they began by charging only 15 cents per gigabyte, and this price has been getting cheaper over time. Currently, it’s in the range of around 3 cents per Gb. This means better service and more savings for you.
Storing large-sized files or a large number of files in the cloud and streaming these in your content remotely can help to keep your web hosting costs down.
Save Time Managing Your Media Content
One of the many benefits and advantages of using a remote storage service like Amazon S3 to add media to your content instead of serving those files from the WordPress Media Library or a free media-hosting site like YouTube is the amount of time you can save managing your media content.
For example, let’s say that you decide to change an image that you have used multiple times throughout your site.
Instead of searching and replacing every instance of that image on your entire site, you can simply upload the new image file and overwrite the old file in your Amazon S3 account. All instances of that file will then automatically update on your site.
Additionally, if you use WordPress, adding media files like images and videos to your content is as simple as copying and pasting the file’s link wherever you would like that file to display.
All images used on this site (except for the featured images containing the titles of our course modules and lessons) are streamed from an Amazon S3 account.
How To Set Up An Amazon S3 Account
To set up an Amazon S3 account, go here.
You can sign up for a free Amazon S3 account and get a generous amount of storage and 12 months free…
This allows you to experience the service without having to pay until you exceed their trial quota or period…
If this is your first time using an Amazon service, create a new account. Otherwise, sign in with your existing Root or IAM user account.
After logging in, go to your Dashboard section and click on Quick Links > My security credentials.
Inside the Your Security Credentials section, click on the Access keys tab.
In the “Access Credentials” section, you will find your Access Key ID code and Secret Access Key code. Click on “Show” to reveal your Secret Access Key code.
You need both your Access Key ID code and Secret Access Key code to use the Amazon S3 service.
Copy both of these codes to a plain text file – make sure there are no spaces at the end of the code strings, or you will experience errors using the service.
Important: Never share your codes with anyone!
Save these codes for now on your hard drive (tip: don’t make the file name or location obvious). You will need these codes in the next step.
Note: If you need help creating directories (called “buckets”) to store your files or setting file permissions (so that other users can view, access, and download your files), we recommend watching the Amazon S3 video course before proceeding to the next step.
You do not have to enable permissions on your files if you don’t plan to share your files with other users or want to keep these files private (e.g. backup files).
How To Upload And Share Files On Amazon S3
After setting up your Amazon S3 account, you can upload files from your hard drive to your Amazon AWS S3 buckets. These files will be stored as an S3 object.
An object consists of the uploaded file and its metadata. You can upload any kind of file you like to an S3 bucket (e.g. images, videos, audio files, backups, data, etc.)
As uploading files to Amazon S3 can be a little technical, we recommend using the tool described below to transfer files between your computer and your Amazon S3 account.
S3 Browser is a freeware tool for Windows users. You can use this tool to access, upload, and share files from your Amazon S3 account.
After downloading and installing the S3 Browser tool, you will need to add your S3 account details (see the previous section for details on how to set up an Amazon S3 account).
Click on ‘Add new account’…
Enter your details:
- Account Name
- Access Key ID
- Secret Access Key
Click ‘Save changes’ to update your settings.
Once your account is set up, the S3 Browser interface lets you access your S3 account.
S3 Browser provides a simple interface where you can perform tasks like set up, delete, and edit ‘buckets’ and folders, configure permissions, upload, download, and delete files and folders, and a whole lot more.
To upload files or folders, navigate to the bucket and folder you want to upload your files to (or create a new bucket or folder), then click on ‘Upload’ and select your option …
Locate and select the files (or folders) to upload and click ‘Open’.
Your files will begin uploading to your S3 bucket on Amazon’s cloud server.
Consider upgrading to the S3 Browser PRO version for additional features, including faster uploading of files to your S3 account.
By default, anything uploaded to your Amazon S3 account will not be accessible to the public. You must set file permissions for uploaded items to make these visible or accessible if you plan to allow other users to view or download your files.
To set file permissions, select one or more files that you have uploaded.
Tick the checkboxes shown in the screenshot below to configure basic access permissions for your files (i.e. display images or share files).
After setting file permissions, click the ‘Apply changes’ button to set file permissions.
To copy your files’ URL(s) to your clipboard, click on ‘Copy’.
You can now paste the URL of your file wherever you need to use it.
For example, if using WordPress, you can add an image to your posts or pages using the WordPress Add Media tool.
If you get an error (e.g. an image or video is not displaying), check that the file’s access permissions have been set by copying the URL and pasting it into your web browser.
If you get an error like the one shown below, it means that your file’s access permissions have not been set (or you have set up hotlink protection for your files on S3).
Open up S3 Browser, locate the file and click on the ‘Permissions’ tab.
Make sure the permission checkboxes for your file are set as shown in the screenshot below.
Of course, if you don’t want users to access your file(s), then leave permissions unchecked.
The image below shows you how to set general permissions for Amazon S3 files and copy the file’s URL to your clipboard.
For more help, information, and tutorials on using the S3 Browser tool, see the tool’s online help documentation and tutorials here:
Additional Amazon S3 Tools
In addition to the tools described above, here are some alternative tools and applications you can use to upload, transfer, share, and backup files using your Amazon S3 account:
S3 File Transfer Tools
- Cloudberry Explorer – This is a freeware file manager for Amazon S3. Cloudberry Explorer provides a user interface to Amazon S3 accounts allowing accessing, moving, and managing files, buckets, and vaults across your local and cloud storage.
- Cyberduck – This is a free 3rd party tool (User Interface) that connects your computer to your Amazon AWS account. Cyberduck is like an FTP client that works with PCs & Macs.
S3 File Backup Tools
The tools below allow you to back up your files and data securely to Amazon S3 and can be used as part of your Content Backup Strategy.
- Snapshot Pro – Snapshot lets you set up automated safe and secure site files and content backups to S3 and other remote storage locations at a frequency that suits you best (e.g. monthly, weekly, daily, even hourly.)
- S3Backup – This is a Windows desktop application that allows you to use the Amazon S3 service for remote backups and secure online file storage.
Congratulations! Now you know how to set up an Amazon S3 account to store your data offsite and how to use Amazon S3 to upload, store, and share your files online.
See the lessons below for additional information related to this tutorial on how to use Amazon S3:
- How To Use Amazon S3 – A video course for beginners with over-the-shoulder video tutorials that show you how to use Amazon S3 quickly and easily.
- Amazon S3 User Guide – Amazon Simple Storage Service guide for users.
Image: Cloud devices (iStock)