# Host a WordPress site with amazon Lightsail and map the domain from a third-party registrar to it

# Overview

Amazon Lightsail is the easiest way to get started with Amazon Web Services (AWS) for developers, small businesses, students, and other users. Lightsail provides developers compute, storage, and networking capacity and capabilities to deploy and manage websites and web applications in the cloud. Lightsail includes everything you need to launch your project quickly – virtual machines, containers, databases, CDN, load balancers, DNS management, etc. – for a low, predictable monthly price.

# Pricing

![pricing.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665975730848/lHsY-Gt0q.PNG align="left")

### Now let us launch the WordPress site in Lightsail

> #### Step1: Open Lightsail and create an instance

*you can click "Let's get started" or click on "Create instance" if you got another Dashboard*


![8.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665976363969/eF0PYCTSw.PNG align="left")

![9.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665976413695/3c_oAw3hP.PNG align="left")
> -  #### Choose Change AWS Region and Availability Zone also choose your instance image.

*You can choose the nearest AZ or region to you and Choose Linux/Unix as the platform*
![10.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665976477131/_keIZitnN.PNG align="left")

> - #### Choose WordPress as the blueprint.

![11.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665976911411/XrXzDbz6f.PNG align="left")

- #### Setup launch script and ssh key pair if necessary (optional)

![12.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665977025290/tfch9ombH.PNG align="left")

> - #### Choose your instance plan

*I have chosen the first one because it is included in the free tier*

![13.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665977143902/KeeX_nieJ.PNG align="left")

> - ####  Enter a name for your instance and choose Create instance.

![14.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665977301590/nec8-zKTU.PNG align="left")

> #### Step2: Connect to your instance via SSH and get the password for your WordPress website

> - ####  choose the SSH quick-connect icon for your WordPress instance.

![16.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665977481844/jcNSXMG7Z.PNG align="left")

> - ####  you get a screen like below

![20.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665977558635/gkvNe_apz.PNG align="left")

> - ####  Enter the following command to retrieve the default application password

```
cat bitnami_application_password
``` 

![21.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665977705700/fRbh5-KbB.PNG align="left")

> #### Step3: Create a static IP address and attach it to your WordPress instance

> - ####  Goto Lightsail dashboard and click on Networking

![34.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1665977966995/ZaqElgGBV.png align="left")

> - ####  Create Static IP

![17.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665978072721/YB0_iBqze.PNG align="left")

> - ####  Select IP location and attach to the instance 

![18.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665978188231/5Ay3pJs5t.PNG align="left")

> - ####  Give a name to your IP and Create

![19.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665978269305/CS-vxZBeT.PNG align="left")

> #### Step4: Sign in to the admin dashboard of your WordPress website

> - ####  Copy the Static IP that you created in step3 and add /wp-login.php and paste it on your browser


![run.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665978594456/2JlQQMNY5.PNG align="left")

```
YourStaticIP/wp-login.php
``` 

```
3.108.145.55/wp-login.php
``` 
> - ####  login to WordPress using the password you obtained from Step2
*Default username: user*

![22.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665978796025/lE0qS9rCM.PNG align="left")

> - ####  Boom!! You are successfully login to the admin dashboard

![23.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665978949357/aiSLZbfLl.PNG align="left")

> - ####  Also the site is live
*you can check by pasting static IP in your browser*

![a.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665979122230/xioGV6_Rv.PNG align="left")

> #### Step5: Mapping static IP to a custom domain
*Note: I have used a domain from [Namecheap](namecheap.com) you can purchase it from route53 or any third-party domain registrar*

> - ####  Open Route53 and Create a hosted Zone

![1.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665979471551/Pvd3Sksq9.PNG align="left")

> - ####  Give the domain name that you purchased (say: shoeasy.me)  and Create hosted zone
*you may add a description and set type to public hosted zone*

![2.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665979633671/OFnUw0ipu.PNG align="left")

> - ####  You will get nameservers, copy that nameserver and add it to your domain DNS

![3.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665979726952/QdLfK0NsZ.PNG align="left")

![4.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665979797392/KXpNoBRSx.PNG align="left")

>Note: It might take up to 48 to update the nameservers but if you are using route53 the process is fast.

> - ####  Create a record and map your WordPress IP to a custom domain name

*leave the record name empty, Choose Record type to A, and on Value paste the Static IP. I have chosen a simple routing policy but you can use it according to your requirements *

![25.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665980325302/XUOpACQZP.PNG align="left")

> - ####  After nameservers are updated you can view/log in to your website using your custom domain

![26.PNG](https://cdn.hashnode.com/res/hashnode/image/upload/v1665979977893/XsAqry9Vc.PNG align="left")

#Thank You



