How to host an https WordPress site on AWS EC2 with a Let’s Encrypt SSL certificate ?

Hosting a WordPress blog/website on the AWS EC2 platform can be pretty useful when you know how to maintain Linux servers and want to tinker it yourself. (Free for your account first-year / then around €10/month) This is great for a small personal blog where you’ll do the maintenance and scalability yourself. (OS, databases, and WordPress upgrades) If you need something more robust and scalable, I usually advise going for WPMUDEV hosting €10 a month packed with there must have performance and security service.

In this post, I’ll show you how I like to host WordPress on EC2 with a Let’s Encrypt SSL certificate.

Start by following the up to date, AWS documentation on how to install WordPress on EC2 and register your domain on Route 53 :

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

php wp-cli.phar search-replace 'ec2-XXXXXX.compute.amazonaws.com' 'YOURDOMAINNAME.com' --path=/var/www/html --skip-columns=guid

Once this is set up and you have your ssh access run those commands :

Once all of those commands are successful, I usually install the ReallySimpleSSL Plugin to modify all your WordPress files to be SSL compliant.

That’s it your website is automatically redirected to HTTPS! (Look for the green lock next to your URL)

Note: If after all those steps you can’t load your site, check your EC2 Security Group Inbound Rules, it needs to allow SSL protocol everywhere.

1 thought on “How to host an https WordPress site on AWS EC2 with a Let’s Encrypt SSL certificate ?”

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top