17.9 C
Monday, January 30, 2023

How to host WordPress Website on Amazon Lightsail 2021

In this article, we will host a WordPress website on Virtual Private Server (VPS) using Amazon Lightsail. Before we begin, we must have AWS Free Tier Account and a Registered Domain. There are different ways to host websites on AWS, like Amazon EC2 but Amazon Lightsail is the easiest way to get started for developers who need to launch project quickly.

By the end of this article, we will be able to understand the following:

  1. Creating Virtual Private Server (VPS) Instance on Amazon Lightsail.
  2. Creating and assigning Static IP to VPS.
  3. Configuring WordPress admin panel.
  4. Creating DNS Zone on VPS.
  5. Configuring domain provider for AWS nameservers.
  6. Configuring SSL on Web Server.

Creating VPS Instance on Amazon Lightsail

What is Amazon Lightsail? When it comes to hosting our website, we have different options: Shared Hosting and Virtual Private Server are two popular type of hosting . Shared hosting is the basic form of hosting which simply means that multiple website share a physical server. Shared hosting is economical and easy to maintain. While on the other hand, we have Virtual Private Server: so-called dedicated server (technically it is still a shared server), it comes with a lot of feature not provided by shared hosting. More feature comes with more price. Without going in to the further details of the two, Amazon Lightsail is used to launch and manage Virtual Private Server.

First of all, we need to sign-in to our Amazon Management Console and search for Lighthsail as shown below:

AWS Management Console

Once we are on the Lightsail dashboard, click on the “Create Instance” button to get started.

Amazon LightSail Dashboard

While creating a VPS instance, we will be asked to select Instance Location, Image, Blueprint, and Price Plan.

Picking Instance Location

Choosing Instance Location

Lightsail is available worldwide. We can change AWS Region and Availability Zone if we need to. If we are creating multiple instances, AWS suggests launching each instance in a separate availability zone to protect your application from a single point of failure. But in our case, we will leave default values of instance location as we are going to create only one instance in this article.

Picking Instance Image

We will choose Linux OS and an App + OS Blueprint with a development stack preinstalled then we will select WordPress image which is a pre-configured, ready-to-run image for running WordPress on Amazon Lightsail.

Choosing Instance Platform and WordPress Development Stack

Choosing Instance Price Plan

Choosing a price plan for Lightsail is quite flexible. We are free to choose a price plan according to the following: Price per month, Memory, Processing, Storage, and Data Transfer. We will choose $3.50 USD per month which is free for three months (up to 750 hours each month).

Choosing Instance Price Plan

Now we need to give a suitable and unique name to our instance to process further. I am leaving the default name as it is.

Instance Name

Click the “Create Instance” button present at the bottom of the page to launch the Instance.

Then we have our newly launched instance on Lighsail. Initially, the state of the instance appears to be Pending, which after a few seconds changes to Running automatically. We can also note that AWS provides us with dynamic IPv4 ( and IPv6 (2600:1f18:8a5:8c00:ba9f:7536:a7d2:2918) of the newly launched instance.

Newly Created Lightsail Instance with dynamic IP Addresses

When we open a browser and request a response from dynamic IP, we will see a WordPress site successfully hosted on the server. Before we do it, make sure that the Instance status has been changed from Pending to Running.

WordPress Website hosted on Server with dynamic IP

Creating and assigning static Ip to VPS

As we saw that a public dynamic IP was assigned to Lightsail instance but it is not a good practice to continue with dynamic IP. So we need to create a Static IP and assign it to our instance. AWS provides Static IP which is free only while attached to any instance.

To create Static IP, go to the Networking Tab and click on the “Create static IP” button.

Lighsail Dashboard

Select the Instance which was created earlier from the dropdown and provide a unique name to identify our static IP. Click the “Create” button to proceed further.

Identifying the Static Ip

Now static IP has been successfully created and assigned to the instance. Note that static IP ( replaces the previously assigned dynamic IP ( to our instance.

Static IP Attached to Instance

To verify this, we can open the browser again to request from static IP ( and we will notice that the WordPress website hosted on the instance. Note that, previously assigned dynamic IP ( will no longer be working now.

Requesting WordPress Website using Static IP

Configuring WordPress Admin Panel

Go to browser and write the following: to log in to WordPress admin panel. We can log in using the default username and password. The default username is “user” and to get the default password we need to connect to the instance using SSH by clicking the button highlighted below.

Instance running on Lightsail

Once an instance connection has been established and you see a command-line tool, write the following commands line-by-line to get a password.

$ ls
$ cat bitnami_application_password
SSH Connection to Instance

You can note the password i.e lykOt1AHLdKK. Now provide credentials to WordPress login to open the admin panel.

WordPress Login Panel with default username and password

We should change the user password immediately after the first login. Now you can do all WordPress stuff like installing themes, modifying content, or installing plugins, etc.

WordPress Dashboard after successful login

Creating DNS Zone on VPS

If we have registered a domain then we can easily map it to any instance on Lightsail. Earlier, we saw that we opened a WordPress site by requesting static IP on the browser. But if we want to open your hosted website using our own registered domain, then we need to create a DNS Zone on the instance. If we do not have a registered domain, we can purchase it from any domain provider like GoDaddy. We can also purchase a domain from Amazon Route 53.

To create a DNS zone, go to the Networking Tab and click on the “Create DNS zone” button.

Now provide the registered domain name and click on the “Create DNS Zone” button.

Registered Domain to create DNS Zone

After we choose to create DNS Zone, we get a set of AWS nameservers as highlighted in the picture below. Later, we will need to configure/modify our domain provider to use these nameservers.

AWS nameservers

To route traffic for our domain name to your Lightsail instance, we will add an address (A) record that points your domain name to the static IPv4 address of our instance. To do this, click on the “Add record” and provide/select values as shown below.

(A) Record creation for www.gulraezgulshan.com (with www)

Click on the green tick button to add a record and we will see a record added as shown below:

Now we need to add another record of type (A) but with a different sub-domain value (without www). Click on the “Add record” button again and provide the values as shown below:

(A) Record creation for gulraezgulshan.com (without www)

Now we have two DNS records updated for domain “www.gulraezgulshan.com” and “gulraezgulshan.com” as shown below:

DNS Records for gulraezgulshan.com and www.gulraezgulshan.com

Configuring domain provider for AWS name servers

Since our domain provider is GoDaddy.com, so will log in to our account and select the domain to change its DNS nameservers. Click on the DNS button to process further.

GoDaddy Dashboard

Now we need to update the nameservers as provided by AWS and save the record as shown below. The nameserver record updating may be followed by a confirmation email by GoDaddy. It can take up to 24 hours to propagate changes before we see the response from our domain https://www.gulraezgulshan.com.

Updating nameserver of domain

Installing SSL Certificate

We will use the Bitnami HTTPS Configuration Tool for configuring HTTPS certificates on the Bitnami stack.

First of all, we need to connect our instance using SSH by clicking on the highlighted button as shown below.

Lighsail Dashboard

It will open an SSH command-line connection to our instance as shown below:

Now, write the command below to get started with the Bitnami HTTPS configuration tool.

sudo /opt/bitnami/bncert-tool

This tool will prompt a few details to configure HTTPS. Below are the answers to all questions that the tool will prompt.

Please provide a valid space-separated list of domains for which you wish to configure your web server: gulraezgulshan.com
The following domains were not included: www.gulraezgulshan.com. Do you want to add them? [Y/n] : Y
Enable HTTP to HTTPS redirection [Y/n] : Y
Enable non-www to www redirection [Y/n]: Y
Enable www to non-www redirection [Y/n]: N
Do you agree to these changes? [Y/n]: Y
Email address: info@gulraezgulshan.com
Do you agree to the Let's Encrypt Subscriber Agreement? [Y/n]: Y 

In the end, you will see a success message showing that Bitnami HTTPS Configuration Tool succeeded in modifying your installation.

Now when you will open your browser and type gulraezgulshan.com, you will see that your connection is secured with HTTPS configured.

SSH to Lightsail, Opening PHYMyAdmin

We may need to open SSH connection to the remote instance using client software like PuTTy and open PHYMyAdmin to view database details of our hosted WordPress website. Read the SSH and Connecting to Amazon Lightsail Instance to achieve this.

Gulraeez Gulshan
Gulraeez Gulshan
I am an engineer, programmer, tech-savvy professional, and very passionate about the latest technologies for the modern web, mobile, cloud-native, machine learning, and network automation. I have a bachelor's degree in Electronics Engineering and a Master's degree in Computer Science and Information Technology from a renowned university in Pakistan. I have not limited myself to a certain set of skills in this era where technology is in a state of flux; I have experience working with an extensive range of technologies and learning daily to update my skills and adapt to the latest technologies

Related Articles


Please enter your comment!
Please enter your name here

Latest Articles