What is AWS Lightsail and How to Use It
Tags: aws, lightsail, devops, cloud
Published: 2023-05-13 21:26:10

AWS Lightsail is a service provided by Amazon Web Services that allows for the quick and easy deployment of cloud-based applications. It provides a cost-effective and straightforward solution for beginners, and enables the rapid creation of high-performance, secure, and scalable applications.

With AWS Lightsail, users can choose from a variety of pre-configured virtual private servers (VPS) options. These pre-configured VPSs have been created as a scaling group that includes the necessary resources such as RAM, CPU, disk space, bandwidth, etc. This allows users to select the most appropriate resources for their application needs and quickly deploy them.

Using the AWS Lightsail service, users can also take advantage of ready-made templates for web applications, WordPress blogs, online stores, e-commerce sites, mobile application servers, and many other types of applications. These templates provide users with guides for application configuration and deployment.

AWS Lightsail also helps developers and IT professionals become more familiar with AWS and learn how to create cloud-based applications.

**Requirements**

To use AWS Lightsail, simply create an account on [here](aws.amazon.com) the AWS Lightsail website and select your preferred VPS template. Then, pay for the service based on the features of your chosen VPS and start using it.
(First 3 months free!)

**Install Nginx App**

Sign in to your AWS account then go to the [Lightsail homepage](https://lightsail.aws.amazon.com/). Page like this:


![Lightsail Homepage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/px5muh5nqptiw6auzowc.png)

We create an instance by going to the Create an instance section.


![Create an instance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/93cyipz6ag48dq4y46e3.png)

For example, let's decide Instance location, Select a platform and what will run last. Select a blueprint

1. I recommend selecting a location closer to your customers.
2. Choose the Linux/Unix platform.
3. Select the Apps + OS from the blueprint.
4. Now choose Nginx from the app list.
 
After making our selections, we will choose Choose your instance plan. You can choose a plan based on your client size.


![instance plan](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wrvbrznis2bxpci9nc57.png)

Our plan selection is over, and finally, we click on the Create instance button and finish our operations. 🎉

**Static IP transactions**

AWS Lightsail Instance comes with dynamic IP. Each time the instance restarts, we will have a new IP address. Come on, let's.


![Public IP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qmnau8sh4gqcz1slm8h3.png)

Our current IP address. Let's reboot and see what happens.


![Public IP 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jx8kv2cjm07bgnlext06.png)

If we don't want a new IP address every time it starts, how to get a Static IP, let's look together


![Static IP](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0vgxkedygrn0eleaitq0.png)

1. Click on the Network tab.

2. Click the Attach static IP button.


![Static IP 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dt0m6c14jem5os6r7tlo.png)

**SSH connection**

In general, we are done, let's see how we can connect with SSH.


![Instance SSH](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ql8hmyx7s9i6tmctqgr5.png)

We can establish an SSH connection by pressing Connect using SSH via the browser.

In order to connect with Putty and similar SSH tools, we will download the SSH key on the page.


![SSH Key](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8hw3w3biyx2ex1722lo3.png)

We download our SSH key file to our device.

If you want to connect with Putty, you can follow the related article.

https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-set-up-putty-to-connect-using-ssh


![SSH Ok](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8nrybuzly6a0skv56cyb.png)

Our SSH operations are finished, we can check the interface by going to your Static IP address. http://ip-address/


**Add Domain**

If we want to connect with a domain, not with your IP address, we click on the Domains settings.


![Add Domain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0ewsayieqj9dawsyena.png)

If you don't have a domain, you can buy it or request a DNS record for the existing domain name.

![Record Domain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lre7g24lg1yf2mc3euwl.png)

1. Create NS records for your existing domain.

2. Get a new domain name

I'm going with option 1.


![DNS Zone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s37bazprln0o3azmobqe.png)

1. Use a domain that is registered with Amazon Route 53

2. Use a domain from another registrar


![Domain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/opussi8efsy97fvx7m8r.png)

You can manage the domain name over AWS by routing NS from the company you purchased your domain name from.

❓ Forwarding may take some time.

**Road End**

Many more operations can be provided on Amazon Lightsail. Our topic for now is here. You can contact me for more.