Skip to content

WordPress On AWS Lightsail: Part 1 – Lightsail

Last updated on 24/07/2020

This is part of a series of blog posts following how I set up my WordPress blog using AWS Lightsail. In my previous post, I talked about why I decided to host my WordPress blog on AWS Lightsail. Now that I have been using Lightsail for a few days and setting it up exactly how I want, I thought I would start a series of posts going over how I set it up.

Getting Started With AWS Lightsail

Before we can start using Lightsail, you will need an AWS account. You can sign up for an AWS account. AWS provides a free tier for the first 12 months that you have the account open. However, to allow AWS to charge you for services used out with the free tier, you must provide a credit or debit card. The free tier does NOT include Lightsail. Once created, you’re all set!

The AWS management console.

Once in the console, find the Lightsail service, which is located under ‘Compute’. Unlike most other AWS services, Lightsail has its own management console. Therefore when you click on the Lightsail link, a new window or tab opens.

Location of Lightsail in AWS console
Location of Lightsail within AWS console.

The dashboard displays all the components available within Lightsail. The five options you have are:

  • Instances – These are where you can find your Linux or Windows instances that you have created.
  • Databases – Lightsail also enables you to create database instances. You can use these instances outside of Lightsail for other projects. At the time of writing, you can create either a MySQL or PostgreSQL database. You do not need to create a database when creating a WordPress site. The deployed instance comes with a database pre-configured for you.
  • Networking – Under networking, you can create static IP addresses (which you will need for your blog), DNS zones, and load balancers. I manage my DNS via Route53; therefore, I didn’t need to use the DNS option within Lightsail. You can also set up a load balancer if you want your blog to be highly available.
  • Storage – Under storage, you can create additional storage disks for your with your instances.
  • Snapshots – Any snapshots created of your instances will be located under this section.

Launching A WordPress Instance

We want to create a new instance. Under the instances tab (if you do not already have any running instances, you should see a ‘Create instance’ button:

AWS Lightsail Console

The ‘Create an instance’ page will then appear. There are several options listed on this page; however, most of them can be left at the default value. Firstly, the instance location. As I am located in the UK, I will use the London region and leave the availability zone set to the default of A (eu-west-2a).

Instance location for Lightsail instance. Set to London Zone A.

Lightsail Instance Image Selection & Configuration

We can then choose if we want our platform to be Linux/Unix or Microsoft Windows. The WordPress blueprint is only available on a Linux/Unix based platform instance. Lightsail is capable of deploying more than just WordPress. For example, you could choose Joomla, Gitlab CE or Redmine. You can also run WordPress Multisite. This is a handy way of running multiple WordPress sites under one instance. They must, however, all have the same top-level domain.

List of platforms and blueprints for Lightsail instance deployment

One thing to take notice of is the option for the SSH key pair. This key pair will enable you to have a secure connection from your devices to the instance. By default, the instance deploys using the ‘default’ key pair. Lightsail creates the ‘default’ key pair for you. The key pair will be located under your account settings or by clicking on ‘Change SSH key pair’ in the instance deploy screen. You can, however, choose to create a new key pair. To do this, click the ‘Change SSH key pair’ option and then the ‘Create New’ button.

Option to create a new SSH key pair in Lightsail instance deployment.

A descriptive name for your new key pair will help, in future, remind you what its purpose is, for example, demoblog.dev.systemsmystery.tech, and click ‘Generate key pair’. Once your key pair finishes being generated, download the key and keep it safe. This is the only time you can download this key, so make sure you keep it secure.

You can choose to enable automatic snapshots of the instance, this allows for easier recovery if something were to happen to your blog. Although I will be using another plugin to backup the installation of WordPress, I also like to have the automatic snapshot enabled as another level of backup. Snapshots incur a charge based on the amount of storage space consumed. More detailed pricing information can be found on the Lightsail pricing page. For now, I will enable this option and select the time of day I would like my snapshots taken.

Snapshots enabled in lightsail

Final Lightsail Configurations

Nearly there! You now need to choose what plan you wish to use for your blog. These plans start at $3.50 and p to $160 a month. My blog is small, and I will only need the lowest level instance currently. As with other AWS services, you are charged for data in and out of AWS. AWS changes their products and price often, I recommend checking out the pricing page for Lightsail for the most up to date pricing structure.

Finally, some housekeeping options. The resource that you are creating must have a unique name. The resource name is displayed under the ‘Instance’ tab of the main management console. In my example, the default name is ‘WordPress-1’, however, that isn’t very descriptive. I will call mine ‘demoblog_dev_systemsmystery’. As with other services, you can also choose to provide tags to help organise your resources better. Using tags is both best practice and helpful when organising your AWS resources. For this instance, I have chosen to use a tag called ‘Product’ with a value of the domain that the resource is associated with.

Identify instance within lightsail

And that’s it! Click the giant ‘Create Instance’ button, go and make yourself a cuppa whist your instance deploys. In reality, it only takes a few seconds for the smallest instance to deploy, but you’ve worked hard to get this far, and we have a lot more work to do! Once deployed, you should see the instance running under the ‘Instances’ tab of the management console.

A running instance in AWS lightsail.

Now we have a running instance, we can now start to configure the setup. Look out for part 2 of this series.

Published inWordPressAWSLightsail