Hosting WordPress Using AWS

Let me start by saying that there are tons of options other options for hosting and running a WordPress website/blog. I choose to sit down and learn about how I can host and run one myself rather than pay a company to host. I have experience running servers and writing code as such I wanted to get more experience in the cloud world that.

Using a service to host and speed up the process can be as simple as a couple of buttons. My goal is to help those who wish to learn a little about how I handled setting up my own WordPress on AWS.

Web Host

The first thing I look at is cost, how much will this cost me? The trick is to understand the cloud and what you can use as a free option. We will only be looking at AWS, but the options for Azure and Google are there and have similar benefits. As of writing this, I pay around $3-4 a month for my EC2 or server and another $7 for my RDS MySQL database. I could however host my database on the EC2 server saving myself the $7, my reason behind using RDS instead was a pure learning experience in which I’ll explain more in detail below.

Cost & Budgeting

Now you are probably wondering, how is it so cheap? Reserved Instances on AWS. First starting off, you can use the free tier for a whole year without paying for anything, this makes learning even better and allows you to get started on your own blog or website without any real cost behind it (minus paying for your Domain Name – website name).

To explain what RI (Reserved Instances) are first we must set up an EC2. You can follow the steps in this guide to get started. Once you created an instance, the next step is to buy a RI. What we are doing here is paying for a term (1 or 3 years) contract, it’s not refundable. As long as the RI you purchased matches the EC2 type, it will be applied. You can set up a budget check to ensure it’s being used. Read more here.

The Reserved Instances can also be applied to the RDS service that would allow you to pay about $5 a month to have a standalone database instance. One benefit that I liked about having RDS separated from my EC2 (WordPress) was I could add an extra layer of security to it using Security Groups. On top of that, the automated backup snapshots that RDS provides makes it easy to revert and restore to a point in time, of course, you pay for this, but it does create a nice simplicity to it. With all that being said, the cheapest and easiest setup is to just use MariaDB within on the Amazon Linux 2 AMI that the WordPress is being hosted on currently.

Differences

The best thing about owning this whole process is the flexibility you gain by understanding how the web and cloud work. By taking the time and learning, you not only save time in the future but also money. Most of the time, you won’t even take advantage of half the features that are given to you from hosting sites.

Let’s take, for example, Bluehost, their basic site cost 2.95 to start (first month) then 8.99 each month after that with a contract (36/mo term). They provide some custom themes, some sort of 24/7 customer support, and some storage but in short, most of these things are really needed due to so many free themes and online support from forums and such. The facts are that you probably won’t ever hit the max storage as a simple blogger, and if you are, then you are probably making enough money to upgrade AWS storage (.10 per GB) or using S3 Buckets.

Bluehost states some free items, one being a domain, CDN, and SSL Certificate. Using them to set up your domain is pretty rough as they would be the ones owning it and require you to transfer it when you want to move providers. A domain costs $12 for a dot com through all cloud providers. There are tons of free options for CDNs and should be considered instead. Finally, a “free” SSL certificate, can be obtained using Certbot (Thank you!) and LetsEncrypt, which is already free with an auto-renewal feature!

Please note, I’m not trying to attack any hosting service, I’m using them as an example and explain why hosting can save you money and provide more control in the long run. Using a hosting service can make anyone’s life easier and get you up and running faster, for a cost. I prefer to use things that are in my control and rather not wait on someone to help or do something in addition to this I prefer to pay for what I use keeping my cost way down.

Resources