AWS, Cloud Computing

5 Mins Read

A Guide to Connect WordPress Site to an Object Storage Bucket using Amazon Lightsail

Voiced by Amazon Polly

Introduction

Amazon Web Services (AWS) offer reliable, scalable, and inexpensive cloud computing services. These cloud computing web services provide various services related to networking, compute, storage, middleware, IOT, and other processing capacities, as well as software tools via AWS. And in this blog, we will understand the uses of Amazon Lightsail.

Amazon Lightsail is a simple-to-use vendor of virtual private servers. Lightsail provides an object storage service in which we will walk through the steps required to set it up on a WordPress site on Amazon Lightsail and then connect the website through Lightsail bucket storage to store the website’s images and attachments.

To begin with this, firstly, we need to install the ‘WP Offload Media Lite Plugin’ on our WordPress site and configure it to connect our Lightsail bucket. Once the connections are established, our WordPress site will automatically upload all media files to the bucket instead of the instance’s disk.

Customized Cloud Solutions to Drive your Business Success

  • Cloud Migration
  • Devops
  • AIML & IoT
Know More

Prerequisites

To get started, we need to complete the following prerequisites.

  • Signup/Login to your AWS account and navigate to the Lightsail console.
  • Create a WordPress site on AWS Lightsail.
  • Create a bucket in Lightsail object storage.

Step-by-Step Guide

Step 1: Modify the bucket permissions:
In this following step, we have to change the permission of our bucket to give access to our WordPress instance and the WP Offload Media Lite Plugin. Th access permission of the bucket must be set to “Individual object can be made public (read-only)”. We must also attach the WordPress instance to the access role of the bucket. If you want to explore the bucket permissions, see the bucket permissions in Lightsail.

  • When we are on the Lightsail page, we must choose the ‘Storage’ tab and then select the bucket we want to use with our WordPress instance.

step1

  • Then, Select the permissions tab on the Bucket management page. Afterward, change permission under the Bucket access permission section of the page.

step1b

  • Here you can see the options ‘Individual objects can be made public and read only’ and click Save.

step1c

  • Then choose ‘Yes, save’ in the following confirmation prompts.

In a moment, the bucket will be configured for individual object access. This ensures that the objects uploaded to the bucket are from our WordPress instance using the WP Offload Media Lite plugin.

step1d

  • Next, scroll to the Resources access sections on the page and select ‘Attach instance’.

step1e

  • Now we have to choose the name of our WordPress instance in the drop-down which appears and then select Attach.
    In a moment, our WordPress instance will be connected to the access role of the bucket, which ensures that the instance has access to manage objects in the bucket.

step1f

Step 2: Installing the WP Offload Media Lite plugin in WordPress Instance

In this step, we must follow the procedure to install the plugin inside our WordPress environment. The plugin automatically copies images, videos, documents, and other media added through the WordPress media uploader.

  • Sign in to your WordPress Instance as an administrator.
  • Look for ‘Plugins’ in the navigation menu, and select “Add New”.
  • Then, search for “WP Offload Media Lite”.
  • As a result, click Install Now

step2

  • Then Activate the plugin once done installing.

step2b

  • Again in the Main Navigation menu, click on Settings, then click ‘Offload Media’.

step2c

  • Now, choose ‘Amazon S3’ in the plugin options at the storage provider. Next, choose ‘My server is on Amazon Web Services, and I’d like to use IAM Roles.’

step2d

  • Then, click Next.
  • Now in the next slide, where it asks, ‘What bucket would you like to use?’ we need to select ‘Browse existing buckets’.

step2e

  • And now, we must choose the name we want to use for our WordPress Instance.

step2f

  • In the plugin settings page, we must enable ‘Force HTTPS and Remove Files From Server.’
    • The Force HTTPS setting must be enabled as the Lightsail bucket uses HTTPS by default to serve the media files. If we don’t allow this feature, media files uploaded to our Lightsail bucket will not be served correctly to the users when they access the website.
    • The next option, Remove Files From Server, ensures that the media files uploaded to our Lightsail bucket aren’t also stored in the WordPress instance disk. If we don’t turn On this option, the media files will be uploaded to Lightsail and the instance server.

step2g

  • Then, choose ‘Save Changes’.

Now our WordPress is configured to use the plugin. From now onwards, any media files that are being uploaded to the media option in WordPress will be automatically uploaded to our Lightsail Bucket and served by the bucket itself.

Conclusion

Lightsail bucket storage is intentionally built with a minimal feature set focusing on simplicity and robustness. Which helps render the media files faster. Amazon Lightsail is becoming a great choice to develop, build and deploy for various applications like WordPress websites.

Get your new hires billable within 1-60 days. Experience our Capability Development Framework today.

  • Cloud Training
  • Customized Training
  • Experiential Learning
Read More

About CloudThat

CloudThat is also the official AWS (Amazon Web Services) Advanced Consulting Partner and Training partner and Microsoft gold partner, helping people develop knowledge of the cloud and help their businesses aim for higher goals using best in industry cloud computing practices and expertise. We are on a mission to build a robust cloud computing ecosystem by disseminating knowledge on technological intricacies within the cloud space. Our blogs, webinars, case studies, and white papers enable all the stakeholders in the cloud computing sphere.

Drop a query if you have any questions regarding Amazon Lightsail and I will get back to you quickly.

To get started, go through our Consultancy page and Managed Services Package that is CloudThat’s offerings.

FAQs

1. Are Lightsail Bucket plans the same across AWS Regions?

ANS: – As AWS expands its availability across more Regions, it’s evolving the infrastructure to provide a better overall customer experience. As a result, plans in certain Regions will have different specifications, such as an additional vCPU, compared to plans in other Regions.

2. How do I create a Lightsail Bucket Storage?

ANS: – As explained above, you only need to log in to your AWS account and navigate to this URL “Lightsail Console”.

WRITTEN BY Guru Bhajan Singh

Guru Bhajan Singh is currently working as a Software Engineer - PHP at CloudThat and has 6+ years of experience in PHP. He holds a Master's degree in Computer Applications and enjoys coding, problem-solving, learning new things, and writing technical blogs.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!