About a year back, I started my website with wordpress.com. I chose the business plan as other plans did not allow me to add any plugins. I was slapped with a 300 dollar bill for the business plan. That is when I started looking for cheaper options. Then I discovered AWS LightSail, the best and the most cost efficient way to host your wordpress website. If you read this entire blog, you will know everything that is required to migrate or create your new wordpress website.

I will give you some advantages of using LightSail :

a) LightSail is cheaper, it costs about 3.50$ (first few months free) per month.

b) LightSail comes with a built in WordPress.

c) LightSail is scalable.

c) All the plugins are free!. In wordpress.com, you need to pay 300$ for business plan to be able to install plugins.

AWS light sail service

Step1: Create a Lightsail Instance:

AWS has an incredible step by step instruction blog to create your wordpress site:

https://aws.amazon.com/getting-started/hands-on/launch-a-wordpress-website/

Ignore the step 6 and step 7 in the above blog, make sure you finish everything until step 5) in the above blog. If you followed everything successfully, you will see something like this:

My Running Lightsail Instance.

Did you get this running ?

Great, So you have got the lightsail wordpress running, it is fully functional. Give it some time and test it.

You can see the public IPv4 and IPV6 in the above picture. Just grab the IPV4 and try running it in the browser. You will see a simple welcome page for wordpress. Please note that your website is not secure. I will walk you through the steps to make it secure in a bit.

To login as a admin, you need to do this:

http://54.145.208.210/wp-admin (The highlighted will be your assigned IPV4), you will get the below screen:

wordpress admin screen

The username will be user

You need to connect to your lightsail instance to get the password, do this:

a) In your lightsail instance , click on the terminal button as shown below:

Click on the terminal button

b) Now, do this in your lighsail terminal to get your default password

cat $HOME/bitnami_application_password

Default password

That’s it, now you are ready to login to your wordpress account from the admin panel and create something beautiful.

Step 2: Let’s create a Hosted Zone in Route 53 before you start transferring the domain.

Go to Route 53, Hosted Zones

create a hosted zone
Create the hosted zone

Make sure you create the hosted zone with the same domain name that you are going to transfer.

After you create the Hosted Zone, you get two records

NS – The Name servers help connect URL’s with IP address of web servers.

SOA – Start of authority record provides information about a domain and the corresponding Amazon route 53 hosted zone.

Step3(Optional): Backup your active website from wordpress.com if you have it.

You can use All-in-One WP Migration to backup everything from your wordpress.com website. If you are in business plan , do it before you remove your business plan , otherwise you can’t use any plugins anymore.

I will leave you with a link which you can use to educate yourself about using the All-in-one WP migration.

https://theme-fusion.com/documentation/avada/how-to/how-to-migrate-your-website-with-all-in-one-wp-migration/

Hold on to the exported file, and you will use it upload your website to lightsail wordpress after the configuration is complete.

Step4: Transfer your domain

Go to the Route 53 service, and click on Transfer Domain:

Transfer domain

It is important that you have a Hosted Zone before you initiate to transfer the domain. Btw, it will cost about 12$ a year to have route 53 register your .com domain.

*Important – Make sure you remove the transfer lock in your current domain name registrar (go daddy, wp.com etc) and copy the authorization code. Mostly the authorization code is sent to your registered email.

In Domain options, select the second option:

Import name servers from Route 53 hosted zone that has the same name as the domain.

Since you already have the hosted zone created, it will show the hosted zones, then give your contact details in the next screen, and review , now purchase!

With wordpress.com , they usually send out an email when you request for domain transfer, and it will just speed up the things.

Quick tip: Change the default TTL of 2 days (172800 seconds) to 300 seconds in your NS type record to speed up the DNS propogation. Do not reduce it less than 300 seconds, as the ISP’s will be ignore it and DNS propagation will not happen soon.

Now wait until domain transfer is complete, look for the status in “Registered domains” in route 53.

Step5: Associate your Static IP of Lighsail instance to your domain

In Route53, under Hosted Zones, create two more records.

a) “A” RECORD – A record with simple routing policy which associates your domain name to the IP address. Example below:

sample A record

b) “CNAME” or Canonical name record – A record with simple routing which associates your www.yourdomain.com to yourdomain.com.

sample CNAME record

Now verify in your PC, by doing a ping or nslookup in your command prompt of your domain name to see if it reflects your new IPV4 address.

Step6 (optional) : Import from the copy of your old website, or , create a new one

Login to your lightsail WordPress admin account.

Import using the file you created in Step 3.

https://theme-fusion.com/documentation/avada/how-to/how-to-migrate-your-website-with-all-in-one-wp-migration/

Or, if you are building something new, start from the scratch, select an amazing theme in your wordpress and create something wonderful.

Step7: Enable Https on your wordpress instance in Amazon Lightsail

Login to your Lightsail instance terminal, bncert tool should be already installed.

  1. Enter the following command to run the bncert tool. sudo /opt/bitnami/bncert-toolYou should see a message similar to the following example.Running the bncert toolIf the bncert tool has been installed on your instance for a while, then you might see a message indicating that an updated version of the tool is available. Choose to download it as shown in the following example, and then enter the sudo /opt/bitnami/bncert-tool command to run the bncert tool again.Message indicating a new version of the bncert tool is available
  2. Enter your primary domain name and alternate domain names separated by a space as shown in the following example.If your domain is not configured to route traffic to the public IP address of your instance, the bncert tool will ask you to make that configuration before continuing. Your domain must be routing traffic to the public IP address of the instance from which you are using the bncert tool to enable HTTPS on the instance. This confirms that you own the domain, and serves as the validation for your certificate.Entering the primary and alternate domain names
  3. The bncert tool will ask you how you want your website’s redirection to be configured. These are the options available:
    • Enable HTTP to HTTPS redirection – Specifies whether users who browse to the HTTP version of your website (i.e., http:/example.com) are automatically redirected to the HTTPS version (i.e., https://example.com). We recommend enabling this option because it forces all visitors to use the encrypted connection. Type Y and press Enter to enable it.
    • Enable non-www to www redirection – Specifies whether users who browse to the apex of your domain (i.e., https://example.com) are automatically redirected to your domain’s www subdomain (i.e., https://www.example.com). We recommend enabling this option. However, you may want to disable it and enable the alternate option (enable www to non-www redirection) if you have specified the apex of your domain as your preferred website address in search engine tools like Google’s webmaster tools, or if your apex points directly to your IP and your www subdomain references your apex via a CNAME record. Type Y and press Enter to enable it.
    • Enable www to non-www redirection – Specifies whether users who browse to your domain’s www subdomain (i.e., https://www.example.com) are automatically redirected to the apex of your domain (i.e., https://example.com). We recommend disabling this, if you enabled non-www redirection to www. Type N and press Enter to disable it.Your selections should look like the following example.Website redirection options
  4. The changes that are going to be made are listed. Type Y and press Enter to confirm and continue.Confirming the changes
  5. Enter your email address to associate with your Let’s Encrypt certificate and press Enter.Associating your email address with your Let's Encrypt certificate
  6. Review the Let’s Encrypt Subscriber Agreement. Type Y and press Enter to accept the agreement and continue.Review the Let's Encrypt subscriber agreementThe actions are performed to enable HTTPS on your instance, including requesting the certificate and configuring the redirections you specified.Actions being performedYour certificate is successfully issued and validated, and the redirections are successfully configured on your instance if you see a message similar to the following example.Actions successfully completedThe bncert tool will perform an automatic renewal of your certificate every 80 days before it expires. Repeat the above steps if you wish to use additional domains and subdomains with your instance, and you want to enable HTTPS for those domains.You are now done enabling HTTPS on your WordPress instance.

Step8(Optional): Plugins required to monetize your website using google AdSense.

Prerequisite: Create a google AdSense account, and register your domain Please go through some online tutorial about google adsense if you are newbie to google Adsense.

ads.txt manager

Now add the google publisher information into Ads.txt under settings:

Ads.txt plugin

It will take a day or two for google to approve after you added the publisher information to Ads.txt .

After the approval, Google Adsense will provide you with a custom script which you can place in the <HEAD> section of your website. For that, you need a WP Code Snippets plugin. You can add it in the Header section as below:

Script for google ads.

If you were able to follow through all the steps, you have successfully hosted and started monetizing your website in lightsail wordpress. This is a great alternative to wordpress.com , you get the reliability and scalability of AWS, and it is super cheap compared to wordpress business plan.

I hope this helps the fellow bloggers. Happy reading!

3 thoughts on “Migrate your website from wp.com to AWS Lightsail and save a lot of $$$.”
  1. Excellent blog! Do you have any tips for aspiring writers? I’m hoping to start my own blog soon but I’m
    a little lost on everything. Would you advise starting with a free platform like WordPress or go for a paid option? There are so many choices out there that I’m totally confused ..
    Any tips? Bless you!

Leave a Reply

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