Tutorial: Setup Load Balanced WordPress website with Lightsail Object Storage

In this tutorial I will walk you through the setup of a load balanced WordPress website setup.
I have a previous video on this setup but in this tutorial I will use the new Object Storage service in Lightsail.
Here is the diagram that we will setup. However the Distribution/CDN will be done in another tutorial so subscribe if you want to see that video:

Load Balanced WordPress setup on AWS Lightsail with Object Storage, Load Balancer and CDN

Steps

  1. Get one instance with WordPress Site setup

Move Database from Local to Database Service

  1. Create database service
  2. Export Mysql database (replace parameters appropriate for your setup, if different)
mysqldump -u root -p bitnami_wordpress > database.sql
  1. Import Mysql database (replace parameters for your setup, if different)
mysql -h [host] -u dbmasteruser -p dbmaster < database.sql

Setup Object Storage

  1. Create a new Object Storage
  2. Change permissions to public and Read-only
  3. Attach instance to the Storage
  4. Install the S3 Offload plugin
  5. Setup the plugin
  6. Test upload

WP-Config Changes

  1. Update wp-config.php with new database connection string

Duplicate instance

  1. Create instance snapshot
  2. Create instance from snapshot
  3. Setup Static IP

Setup Load Balancer

  1. Create Load Balancer service
  2. Attach both instances.
  3. Create SSL Certificate
  4. Update DNS for www. domain
  5. Attach SSL to Load Balancer
  6. Enable session persistence setting
  7. Attach 2nd instance in Object storage

If you have an existng website with many plugins you may have to perform a few extra steps or fix issues that arise with plugins and themes that do not work well in this setup. Also for existing websites I suggest you migrate the website to new instances, instead of making your existing instance setup this way.

Additionally the one thing that I haven’t found how to solve is updating Themes and Plugins. Those files/folders are not shared across the instances so you have to update them manually on each instance. If you have any ideas on how to make that better please let us know in the comments below.

All videos tutorials on the website as well as the YouTube channel aim to provide a simplified process for a specific scenario; there could be many different factors and unique use cases you may have. The tutorials may not cover every situation; so treat is as a starting point or learning concept to apply to your unique situations, and consider this inspiration but not prescription or explicit direction.

Scroll to Top