Install WordPress on AWS EC2 Instance with SSL

Step by step tutorial to setup WordPress website on Amazon Web Services EC2 instance with free control panel Virtualmin and nginx.

WordPress and Amazon Web Services is a winning combination. Although bit expensive than other hosting solutions, AWS certainly has its advantages when it comes to advanced features. Webmasters could easily setup auto-scaling or load balancing for high traffic websites using AWS advanced features. If you like to use any of those features, you need to install WordPress on AWS EC2 instance first. This post will give you step-by-step instructions to do that.

WordPress is fully compatible with Amazon Web Services. AWS EC2 instances are basically VPS. They can be configured as high performance web servers with little extra work. I’ll walk you through configuring your AWS EC2 instance and installing WordPress with SSL. I’ll try to make this tutorial as newbie friendly as possible.

We’ll be building our WordPress web server on AWS with Virtualmin v7.1 GPL control panel. It’s a free control panel and packs powerful features to manage a web server. Additionally, we’ll be installing Nginx v1.22, PHP v8.0 and MySQL v8. Complete below steps to install WordPress on AWS EC2 Instance with SSL.

freelancer to install wordpressNot a tech guy? Rather have a freelancer install WordPress on Amazon Web Services for you?
Hire me and have your WordPress ready within 24 hours!
Get WordPress Installed

Step #1 – Create an EC2 instance for WordPress and install Virtualmin

This step will get your AWS EC2 instance ready for WordPress. We’ll create an EC2 instance with Ubuntu 20.04 as operating system and install Virtualmin. This is the hardest part of the WordPress installation process. But my newbie friendly instructions will make it easy to setup your EC2 instance with Virtualmin even if you’re totally new to AWS and EC2.

Tutorial: Install Virtualmin on AWS EC2 instance

Step #2 – Add your WordPress domain to Virtualmin on AWS

You should have a domain name or subdomain ready for WordPress by now. It’s now time to add it to Virtualmin. Virtualmin has something called Virtual Servers for this purpose. You need to create a top-level server within Virtualmin for each of your domains. Don’t forget to point your WordPress domain to EC2 instance with an A record.

Tutorial: Add WordPress domain to Virtualmin

Step #3 – Enable SSL (https) for WordPress on AWS EC2

Virtualmin comes with built-in support for Let’s Encrypt SSL certificates. Now that you have Virtualmin installed and WordPress domain added to your EC2 instance, it is the perfect time to enable Let’s Encrypt SSL for WordPress. Let’s Encrypt SSL certificates are issued free of charge and Virtualmin is capable of auto renewing them.

Tutorial: Install Let’s Encrypt SSL Certificate for WordPress with Virtualmin

Step #4 – Obtain WordPress MySQL database credentials from Virtualmin on AWS

Virtualmin automatically creates a MySQL database for your WordPress when you add your domain with above instructions. But it won’t display login credentials on-screen. You’ll need this information to complete the WordPress installation on AWS EC2. Fortunately you can easily get MySQL credentials from Virtualmin.

Tutorial: Obtain WordPress MySQL credentials from Virtualmin

Step #5 – Install WordPress on AWS EC2 with Virtualmin

You have everything setup for WordPress now. We took care of every little configuration that is required to run a perfect web server on Amazon Web Services EC2. This step is to actually install WordPress on your AWS EC2 instance. Complete the installation with below tutorial. You can ignore the prerequisites section.

Tutorial : Install WordPress with Virtualmin

Step #6 – Redirect http to https with Virtualmin on AWS

Your WordPress should be fully functional at this point. We will wrap things up by setting up 301 redirects from http to https. This step increases WordPress security a bit. This will make sure nobody can spying on your WordPress traffic.

Tutorial : 301 Redirects from http to https with Virtualmin

That’s it. If you’ve followed all the steps above, you now have a superfast WordPress installation on Amazon Web Services with Virtualmin control panel and LEMP stack. Head over to our sysadmin support forum to get help if you run into errors.


Hey!! I'm Tharindu. I'm from Sri Lanka. I'm a part time freelancer and this is my blog where I write about everything I think might be useful to readers. If you read a tutorial here and want to hire me, contact me here.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button