Learn how to set up and use Amazon S3 to store, manage, and serve content on your website.
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.
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.
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 S3video 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:
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.
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:
Learn about tools you can use to send files to other users and transfer files between devices, your web server, and cloud storage services.
File Transfer Tools
Learn about tools you can use to send files to other users and transfer files between devices, your web server, and cloud storage services.
Sending and receiving files to and from other users, transferring files between different devices, and uploading or downloading files or media from various computer devices to your website, server, or remote storage services are all essential aspects of managing your content effectively.
In other lessons, we’ve looked at setting up effective content storage systems and documenting these processes to manage your organization’s files, media, and content.
If you need help in those areas, refer to the following lessons:
In this lesson, we look at various file transfer tools and methods you can use to get your content and files quickly and easily to other users, devices, web servers, and cloud storage services.
Essential File Transfer Tools
Transferring Files To Your Server Or Remote Storage
Uploading Files To Your Website From Different Locations
Using CMS Features To Upload Files To Your Website
Essential File Transfer Tools
Being able to transfer files quickly and easily to other users is essential for areas like content production, so it’s important to organize your content management systems around tools like:
Email (e.g. Gmail, Outlook, etc.)
Team Communication Tools (e.g. Zoom, Slack, etc.)
You already know that you can send files via email as an attachment.
But…did you know that with certain applications like Gmail, you can also send your files via email securely?
For example, Gmail offers a confidential mode that prevents your email recipients from forwarding, copying, printing, or downloading either the message or its attachments. This helps you protect sensitive information from being shared accidentally or without your consent.
Watch the video below for more information about this feature:
With Gmail, you can also insert a file from Google Drive as an attachment (we cover Google Drive further down)…
Mobile devices are another great tool for sending media files like images, videos, audio recordings, notes, etc.
See the ‘References’ section at the end of this lesson for links to excellent articles covering different methods you can use to transfer files using your mobile devices.
Team Collaboration Tools
Applications like Slack, Zoom, and many other tools have built-in features for sharing files, so your team can use these to quickly send files to different team members and across to other users and departments.
For example, Slack lets you upload files like documents, videos, artwork, etc. from your computer and shared drives and share these with your team.
Zoom also lets you upload and share file attachments, as the video below shows.
Transferring files using a desktop FTP application like Filezilla is all done via the tool’s interface.
Filezilla’s interface looks complicated, but it’s really not. After connecting to your server, all you basically do is select files from a folder in your computer or hard drive (left panel) and drag these across to a folder on your server (right panel) and the tool will automatically begin to upload your files.
Similarly, you can download files by selecting and dragging these from a folder on your server (right panel) to a folder on your computer or hard drive (left panel).
Transferring Files Using cPanel’s File Manager: Step-By-Step Tutorial
Let’s show you how to use cPanel’s File Manager to upload files from your computer or external hard drive to your web server.
We’ll go through a step-by-step example on how to upload and extract a zipped file.
Note: Make sure your hosting uses cPanel for this tutorial. Otherwise, check with your hosting company to see what file transfer tools they provide.
First, log into cPanel…
File Manager is located in the Tools > Files section of your cPanel administration screen.
Click on File Manager…
Your server files will be visible inside the File Manager screen.
Some of the main functions you will use inside File Manager to perform file transfer operations include:
Move File – allows you to select files and move them into another directory. This feature is useful if you upload files to the wrong folder and want to move these to another folder location.
Upload – allows you to upload files directly to your server. This feature is useful when performing manual software updates, and restoring or reinstalling website files.
Download – allows you to download files from your server to your local machine. This feature is useful when performing manual backups.
Delete – allows you to delete selected folders and files on your server.
Extract – allows you to unzip files inside your server directories. This feature is useful for uploading folders or multiple files (covered below).
Compress – allows you to compress (zip) folders inside your server directories. This feature is useful for downloading entire folders, large files, etc.
Additionally, you will find useful Directory Navigation Menu Buttons inside the File Manager area, including:
Up One Level – Moves files up one level inside the folder.
Reload – Refreshes your screen.
Select All – Selects all files.
Unselect All – Unselects all files.
Using File Manager To Upload And Extract Zipped Files
In this example, we’ll show you how to upload and extract a zipped plugin file to your server.
First, make sure to have your zipped file ready for upload.
Next, log into cPanel and open up the File Manager panel.
You can drill down folder hierarchies to access nested folders and files by double-clicking on the upper directory folders.
Next, locate the folder on your server where you will upload your file and click Upload.
In the screenshot below, we will upload the zipped plugin file into the plugins folder section of our WordPress site installation.
A new screen called ‘Upload files’ will open up in your web browser. You can drag and drop files into the section with the dotted border to automatically begin uploading your files, or click on the ‘Select File’ button as shown below, then locate and select your zipped file to upload.
Select your file and click ‘Open’ to begin uploading the file to your server …
File Manager will begin to upload your file to your server. Wait until the file has finished uploading.
Once your file has been uploaded, click on the “Go Back…” link to return to the folder inside your File Manager’s screen where you have uploaded the file to.
You should see the file you have uploaded inside the folder on your server.
If you cannot see the file, then do the following:
Check that you are in the correct folder, and
Click the Reload button to refresh the screen.
Also, if you upload a file to the wrong directory, use the Move button to select the right destination folder for your file.
After your zipped file has been uploaded, click on the ‘Extract’ button to decompress (unzip) your file.
A pop-up window will appear asking you to confirm the location where you want to extract your files to. Click Extract File(s) to continue.
The ‘Extraction Results’ window displays all of your extracted files once the operation has been completed.
Click Close to return to the File Manager screen.
Click the Reload button to refresh your screen.
All uploaded files are now extracted and added to your server.
You can delete the original zip file from your server to save space and keep your folder free of unnecessary clutter.
To delete the zipped file, select it in your File Manager screen and click on the Delete button.
The above method for uploading files to your server is useful. Large files that normally take a long time to upload via FTP can upload in seconds or just a few minutes when transferred using cPanel’s File Manager.
Not all hosting companies offer cPanel. Many hosting companies, however, offer a file manager application, so check with your web host.
How To Configure Server File Permission Settings
Most software program installations nowadays will configure everything automatically for you. Sometimes, however, you may need to manually set permissions to allow other users to read, write, modify, and/or access information after uploading some files or programs to your web server.
File permissions specify what can and can’t be done to your server files and folders or directories.
This is important because some applications need to upload or access files in some of your server directories to perform certain functions. If permissions for these files or directories are not enabled or set correctly, it can cause errors.
For example, if your site runs on WordPress and permissions have not been automatically set or enabled for files in your wp-content directory, you may experience errors when uploading plugins or you may not be able to save changes made to plugin settings.
Refer to the short tutorial below to learn how to configure server file permission settings for files and directories on an open-source operating system like Linux.
Again, we recommend doing a full backup of your website’s files and data before modifying any files on your server.
How To Configure File Permission Settings On Your Server (Linux)
Chmod (abbreviated from change mode) is a command that lets a user tell the system (or server) how much or how little access it should permit a file or a file directory to be given.
It changes the file system modes of files and directories, including permissions and special modes.
Setting File Permission Settings Using ‘CHMOD’
If you use an FTP program like Filezilla, do the following to view and change security permission settings for your server files and folders:
Access your server
Locate the directory or file with the permissions you want to change
Right-click on the file and select ‘Properties’
The CHMOD options should display in the menu. If not, access the help section of your FTP client and search for chmod, permissions, or change mode. Most FTP programs have this feature readily available.
To change or set permissions for your files, simply check or uncheck the permission boxes (for Owner, Group, or Public), or add the desired permission setting number in the Manual display field, then click OK to save.
Common WordPress file and directory permissions include the following settings:
777 – Everything for everyone. This command gives read, write, and execute permission to the owner, group, and public. chmod 777 is considered potentially dangerous because you are giving read, write, and execute permission on a file/directory to everyone on your system. Normally, this setting should be avoided.
755 – Only the owner can write, read and execute for everyone. This command means that only the owner will be allowed to write to the file. The owner, group members, and everyone else will have read and execute permissions.
644 – Everyone can read, only the owner can write. With this setting, the owner will have read and write permissions while the group and everyone else has read permission only.
Setting directory permissions to make your files writable depends on your web hosting environment. For example, to make a file or directory writable, you would normally set (i.e. chmod) file permissions either to 777 or 755.
Only change file permission settings if your site installation or plugin requires it. Normally, this will either be specified in a user manual (e.g. a plugin manual or installation guide) or if changing file permissions is required while performing some kind of function on your site (e.g. installing or making changes to plugins or themes).
If you are performing installations using wizards, a notification message will usually appear on your screen asking you to make a particular file or directory writable, or specifying which permission settings you need to change.
Unless the change required to the file permission settings is permanent, you would normally restore the file to its original settings after making and saving the change for security purposes (e.g. changing a file from 644 to 755, then back to 644 again). This prevents hackers and unauthorized users from accessing and modifying the files on your server.
After making changes to files, refresh your site’s page in your browser to make sure that everything is working correctly.
Changing file permissions is not complicated. However, if you don’t know what you’re doing or if you are concerned that you might do something that can cause errors, don’t modify any files. Instead, ask your web hosting provider or someone with more knowledge or experience to do this for you.
If you experience errors after changing permission settings, change the permission settings back to what they were and see if the error messages disappear. If errors persist after restoring file permissions, contact your web hosting provider for help.
Use this handy chmod calculator if you need help configuring different file or directory permissions.
If you are hosting media files (e.g. an image) on Amazon S3 (covered in the next section) and the file is not displaying correctly on your browser, you may not have set the correct permissions for that file.
Typically, this is what you will see if a file has incorrect permissions…
To display images stored on Amazon S3 on your website’s pages, set your file permissions as shown below:
Owner – Tick the checkbox
Any AWS Users – Leave the checkbox unticked
All Users – Leave the checkbox unticked
Owner – Leave the checkbox unticked
Any AWS Users – Tick the checkbox
All Users – Tick the checkbox
After ticking the boxes as described above, click on Apply changes to set your file permissions.
The images should now display to your website users. The Amazon S3 section below shows you how to add media files from S3 to your web pages.
Transferring Files To Cloud Storage Services
Your website files can be stored on your web server or a cloud storage service.
Some of the most popular storage services for storing files remotely in the cloud include:
Let’s take a brief look at each of these services and how to transfer cloud-hosted files to and from your devices and your website.
Amazon S3 (Amazon Simple Storage Service) is a scalable cloud storage service offered by Amazon Web Services (AWS).
Amazon S3 is great for storing all kinds of files, especially media files, website backups, data archives, and more.
Amazon S3 storage folders are called buckets.
A bucket is a container for objects stored in Amazon S3. You can store any number of objects in a bucket and can have up to 100 buckets in your account.
Many applications can connect directly with your Amazon S3 account, allowing you to quickly and easily upload and store files in your s3 buckets and serve these directly on your website.
For example, the image below is being hosted on Amazon S3.
To check this using Google’s Chrome browser, right-click on the image and choose Inspect.
You should see an Amazon S3 bucket address displayed for the image.
Uploading files directly to Amazon buckets can be a little complicated, so we recommend using a tool like the one below to transfer files to and from your computer or hard drive and your Amazon S3 account…
S3 Browser is a free Windows client for Amazon S3 and Amazon CloudFront, a content delivery network, (CDN). We use and recommend installing the paid version of this tool as S3 Browser is free for personal use only.
Also, as this site is built using WordPress, media files stored on Amazon S3 can be inserted directly into the content, so here’s what we did to display the image above on this web page:
First, we uploaded the image to our Amazon s3 account…
After the image was uploaded, we then set file permissions as explained earlier, right-clicked on the file, and selected Generate Web URL…
We then copied the URL of the image to our clipboard…
And pasted the URL into the content…
That’s it! When you look at that image on our web page, it’s being served from Amazon S3, not from our web server.
Google Drive lets you store files on Google’s servers in the cloud. You can also share files and synchronize files across different devices.
Google Drive is great for storing documents, spreadsheets, presentations, drawings, forms, and other files created using Google Docs, Google Sheets, and Google Slides. It also lets you collaborate with your content team to edit your documents.
Files created and edited through the Google Docs suite are automatically saved in Google Drive. You can also upload large files (up to 750 GB in size), and change privacy settings for individual files and folders, including enabling sharing with other users or making your content public.
Tutorial: How To Embed Files From Google Drive Into Your Website
You can easily embed files from Google Drive into your website.
In this example, we’ll embed an image stored on Google Drive into a WordPress site.
Note: You can use the same method as shown in the tutorial below to embed other types of files into your site like videos, audios, etc.
After uploading your media file to Google Drive, right-click on the file and select Preview.
Next, click on the vertical ellipsis icon (More Options) and select Open in new window…
Click on the vertical ellipsis icon again and select Embed item…
Copy the embed code to your clipboard…
If you are using the WordPress classic editor, switch to the Text tab and paste the content from your clipboard into the location where you want your image (or video, or audio file, etc.) to display.
Your embedded file should display when you publish and preview your content.
In addition to the Media Library, there are various WordPress Media Plugins you can use to transfer and manage files on your site from your computer and cloud storage services.
For example, S3 Media Maestro lets you display videos hosted on Amazon S3 securely on your site.
If you store files on Google Drive, you can use a plugin like Google Drive Embedder to add files to your content.
You can also use a plugin like Dropr to easily access files from your Dropbox account and add them to your WordPress website.
For more plugins that can help you manage the transfer of files to your WordPress site, see this section: WordPress Media Plugins
WordPress Automatic Updates
WordPress has a built-in feature that automatically transfers data like new software updates, plugins, and themes from the main WordPress repository (WordPress.org) to the WordPress installation files in your server.
It also automatically uploads, extracts, and places all data directly into the correct folders inside your web server and database.
The WordPress auto-updating feature is useful for transferring files from your server when:
Updating WordPress via the dashboard
Uploading and installing WordPress plugins
Updating WordPress plugins
Uploading and installing WordPress themes
Updating WordPress themes
The ability to perform updates directly inside your WordPress dashboard is extremely convenient. However, keep the following in mind…
One-click updates work on most servers. If you have any problems, it is probably related to permissions issues on the filesystem.
See the section earlier on configuring server file permissions if you run into any issues with WordPress (also refer to this WordPress Troubleshooting Guide if you experience other errors on your site).
Zapier lets you connect and integrate your web applications and automate your workflows.
Essentially, Zapier allows thousands of different applications to communicate with each other and create all kinds of “when this happens…automatically do this” tasks (called “Zaps”), saving you a lot of time in the process.
Zapier also offers many integrations with WordPress.