How to set up a Billing Alert for your AWS Lightsail WordPress Website

What are Billing Alerts and why you should use them

Billing Alerts are a process that you can set up where AWS will contact you and let you know if your budget is about to be exceeded for your WordPress Website. Why would you want this? In case you are now aware, AWS bills you for what you use rather than what what you intend to use. With this in mind if there is a runaway process spending money on your site that you did not intend, or realise, you will want to know about it before it becomes really expensive! 

When you set up a Billing Alert, you instruct AWS to send you a notification and tell you how much money you are spending on your WordPress Website based on whatever settings you set. Billing Alerts allow you to potentially see an before it becomes a problem and ultimately will save you money. A Billing Alert takes from 5 to 10 minutes to setup so they are quick, easy and quite useful. 

Setup a Billing Alert

To set up a Billing alert you need to go to your AWS Console. This is not the same as your AWS Lightsail Console in case there is any confusion. Your AWS Console is where you manage your entire AWS setup while your AWS Lightsail Console is where you manage your Lightsail WordPress Website. 

Ok so once you have opened the  AWS Console, which presently looks like this:

You want to click on “Billing” and this will open the “Billing & Cost Management Dashboard”. Next you want to click on “Budgets:

and then “Create budget”:

Choose your Budget

Now you need to decide on what kind of budget you want to create. You have a choice of:

  • Cost Budget
  • Usage Budget
  • Reservation Budget
  • Saves Plan Budget

For the purposes of this article I am going to focus on the first choice which is a Cost Budget. Select this (it should be selected by default but just in case!) and click “Set your Budget”.

In the next view you need to give your budget a name, which can be anything you want and a timeframe (called a period) for the budget to apply to. I would recommend a monthly period though this is up to you as it depends on exactly what you want from this Cost Budget:

Recurring or Monthly Budget

You can then decide if you want this to be a recurring budget or an expiring budget, which basically means does the budget apply over and over again based on the period you selected. Or is it a one use budget that expires. You need to select a “Start Month” for both options however an expiring budget will also need an “End Month” selected.

How much to spend for your Budget

Now you are going to specify your monthly budget. The easiest way to complete this is to choose Fixed and set a Budgeted amount that you are happy to spend inside the Budget period. For example I have set this Budgeted Amount to $20:

You do have another option and that is to select a Monthly Budget Planning which is where you would decide in advance what you want each month’s budget to be. 

Once you have made your decision on whether to go with Fixed or Monthly Planning and input your budget prices, scroll down to the end and click “Configure thresholds”. 

Define your Budget Threshold

On the next view you will Define your budget threshold. This is the value that AWS will use, based on whether you set it as Actual Cost or Forecasted Cost, to notify you when your threshold is achieved. 

To complete this you have two options. You can set an Actual Cost or a Forecasted Cost. Actual Cost is exactly what it says it is, it is the exact cost that AWS will charge you. Forecasted is more like what AWS believes it will charge you. 

I would suggest that you set your Budget to Forecasted Costs. From my experience this is a good setup if you want to keep your costs down as you can view what AWS thinks your website’s performance will be based on historic data a few weeks in advance. This will allow you to tweak, or even completely remove, a process or maybe a plugin that is eating up your system resources and ultimately costing you money. 

For the Alert Threshold itself, you can set this to a % of the budgeted amount for which I would recommend something like 85%. The reason for this is that it still leaves you enough budget, generally speaking, to investigate any spending spikes that are occurring and take any actions required.  

With this setup AWS will contact you when your monthly spend Forecast is 85% of your Monthly budget ($20) which is $17.00 or more.

Budget Notifications

Next you want to set your Notifications. This is how AWS will contact you when your Budget spend is, going by our example above, forecasted to be $17.00 or more. The easiest setup here is to input an email address into the Email recipients section:

You can add up to 10 email addresses to this box (comma separated) and the email addresses do not have to be associated with your AWS account login.

Once this is all completed click on “Confirm Budget” in the bottom right and you are done. You have now completed a Monthly Budget for your AWS Lightsail WordPress Website and you have set up a notification for when your budget spend is approaching your maximum. 

Budget Bonus Tip

As a final bonus tip you can edit any budget you have created at any time by going to the Budgets section in the Billing view in your AWS Console. Just click on the Budget name to edit and make whatever changes you need.

Thank you for reading this guide and I hope you find it useful.

AWS Lightsail WordPress Website Setup Blog Logo

AWS Lightsail WordPress Website Setup

When you decide to create your own website you have many options. If you are attempting to keep costs down while still being scalable and efficient, the best option I have found is to use a WordPress Website on AWS Lightsail. There can be a lot of steps in this setup but it is pretty straight forward if you follow this guide. What I really like about this setup is that the upfront costs are minimal and the ongoing costs are also quite cheap. Your costs for this setup are:

  • AWS Monthly Cost (First Month Free! $3.50 p/m afterwards)
  • Domain Name Cost (Varies)

When I was first creating the WYN website I shopped around quite a bit for a website host and honestly this is the cheapest I found which still had excellent performance. Performance is important to me as I want my website to stay live. So if you are basing it solely on cost based performance, then this is the setup for you. This post will guide you through the processing of setting up your WordPress Site using AWS Lightsail.

To get started, first off you need to create an Amazon Lightsail account which you can do here.

Create an Instance for WordPress on your AWS Lightsail Account

Next you are going to Create a WordPress Instance in Lightsail. This will be your website. To complete this you need to sign in to your Lightsail Console and click “Create Instance” on the Instances tab:

Next you will be selecting your region, which you can either set based on your location or your audience’s location. Ideally you want it to be your audience if at all possible. Next select “Linux/Unix” and then select “Apps + OS” and “WordPress”:

Now you will choose your instance plan. This is how much it will cost you per month. I recommend the cheapest option unless you are expecting a considerable amount of traffic. Another great reason for the cheapest plan is that you get your first month completely free. What plan you ultimately choose is up to you so choose what you need taking your budget into account.

Remember to give your Instance a name which you can do in the next section:

Finally click “Create Instance” at the bottom of the page:

Once this is completed you will have created your server instance for your WordPress website. So far, so good! Now you need to create a Static IP Address and Attach it to your Instance.

Create a Static IP Address and Attach it to your Instance

Newly created servers do not have a static IP address, you need to create one. Thankfully it’s pretty easy to complete. Back on your AWS Lightsail Console click on the “Networking” section. 

Next click on “Create Static IP”

Select your WordPress Instance that you want to attach the Static IP you are creating to. This would be what you created in the last section of this post. Using the screenshot below this would be “WordPress-1”. Also remember to give your Static IP a name you can identify later. I would recommend a variation of your domain name. This is so that you can easily identify it later. 

Once this is all completed, click “Create” at the end of the page. Now your website has a Static IP address. You can visit your website by inputting this IP address into your web browser and this IP address will always point to your website. If you did not complete this step, the IP address of your website could change. Now this is no longer the case. Awesome job so far!

Retrieve your WordPress Admin Password

By default the admin password that you will use to login to your WordPress account is stored in your WordPress instance. To retrieve it you need to login to your WordPress instance. To accomplish this go to your AWS Lightsail Console and in the “Instances” tab, click on the SSH quick-connect icon as per:

This will open a popup which has your browser based SSH client window. It will look like this:

Once it loads a command input line will appear in this format:

bitnami@ip-(ip address):~$ 

Enter the following text command to retrieve your WordPress password:

cat $HOME/bitnami_application_password

The password will appear under the command once you hit enter. Save this password somewhere safe as it is your Admin password for your WordPress website. 

Logging into your WordPress Website

Now you have your admin password as well as changed your WordPress website to use a static ip address. So far this is great. Lets keep this ball rolling and get you logged into your WordPress website. To accomplish this you need to open a web browser and go to:

https://StaticIPAddress/wp-login.php

If you have forgotten your StaticIPAddress it is easy to retrieve it. Go to your AWS Lightsail Console and in the “Instances” tab click on the WordPress Instance you have created. This will open a new view that will show you information on your WordPress Instance. If you scroll down to the “CONNECT TO” section, you will see your Static IP address. 

Once you input the url above correctly using your Static IP Address, a popup will appear that will ask you to input your username and your password. 

In the username input “user” and in the Password box put in the admin password that you retrieved earlier. Finally click “Login”. Now you are logged in to the admin panel of your WordPress website. From here you are free to design your WordPress website however you wish. 

Domain Name

At this stage you need a domain name for your website. If you do not use a domain name your website address will be your static IP which is not ideal for many reasons so I would recommend you get a domain name for your WordPress website. If you already have one then awesome. If you do not, there are dozens of sites that you can purchase one from. I recommend finding a domain host that offers you the best value for the domain name you want to use.

For Lightsail to correctly manage your WordPress hosting you will need to transfer your purchased website domains DNS to Lightsail. If you know what all this means then awesome. If you do not, in a nutshell you will be still paying for the domain name from your domain host but Lightsail will be managing the actual domain itself. Your domain host will send the data to Lightsail and Lightsail will take the actions required for your WordPress website to work as intended. It will also allow you to manage your DNS directly on Lightsail as opposed to on your Domain Host. If this sounds complicated, it really isn’t but I do get that if this is your first time it might be overwhelming. My advice is to take it slow and follow this guide. When I originally completed these steps I had little experience with DNS and I was able to complete it without issue so while this may seem daunting it is not as complicated as it looks.

To compete this setup, in your AWS Lightsail Console go to the “Networking” tab:

In this section click on “Create DNS Zone”:

 In the next page enter the domain name you have purchased/registered and click “Create DNS Zone”:

You will now see a list of 4 Name Servers. Copy these as you need to add them to your Domain Host Name’s register. Each hosting provider has a slightly different setup to complete this so my advice is to email your Domain Host’s support team and ask for this to be completed for you. 

Once this is completed, which you will be able to see by logging into your Domain Hosts DNS console (the Name Servers will be present), you then need to add an A record in Lightsail to point your domain to your WordPress Instance:

  1. Go to the “Networking” tab in your AWS Lightsail Console
  2. Under “Global”, click on the DNS Zones
  3. Next click “Add Record”
  4. In the drop down select “A record”
  5. In the Subdomain section add an: @ symbol
  6. In the Maps to section, add the Static IP you have created for your WordPress Website. 
  7. Finally click the Save icon

Once completed this will transfer the management of your domain’s DNS records to Lightsail. Please be aware that this could take anywhere between 24 and 72 hours to be completed. This is due to how DNS in general is set up as the DNS cache needs to expire. There isn’t really a way to speed this up. 

And you are now done. In a future article I will cover how to setup a new free SSL Cert for your AWS Lightsail WordPress Website, suggestions on how to manage your billing more efficiently and more.

Thank you for reading this guide and I hope you find it useful.