Amazon LightSail – Virtual Cloud Server

Introduction

Amazon Lightsail, launched in 2016 is essentially a virtual private server (VPS) that offers you everything needed to deploy an application or website, in a cost effective and easy-to-understand manner. It is a basic service but extremely convenient.

It is designed for customers, developers, small business or startups to get quickly started in the AWS as it reduces the learning curve in the beginning, and user can later adopt the broad AWS Services as they get more familiar with the AWS cloud and/or solution workload increases.

Under the hood, Lightsail is powered by Amazon EC2, Application Load Balancer (ALB), and other AWS services and by doing this it offers the level of security, reliability, and scalability you are expecting from AWS.

It also works great with container workloads. You can deploy your container images to the cloud with the same simplicity and the same bundled pricing Amazon Lightsail provides for your virtual servers.

In this post, we will cover the following topics:

  • Virtual Private Server Basics
  • Getting Started with LightSail
  • LightSail Container Service

Virtual Private Server Basics

Amazon Lightsail is a powerful virtual private server (VPS) built for reliability and performance.

AWS Lightsail is Amazon’s answer to the rise of Digital Ocean, OVH, Linode LLC, and other affordable VPS players in a very lucrative VPS market. Lightsail started as a pretty basic service, but over the years, AWS added features like block storage, Windows support, databases, and containers. Given the history, you can expect some more additions by the time you read this post.

A virtual private server (VPS) is a hosting solution relying on virtualization technology to provide dedicated resources on a server with various users.

A VPS divides real dedicated servers into numerous virtual machines or servers, each with its own hardware, operating system, and applications. VPS hosting is a shared hosting service in which each client has their own virtual machine,” but they function and store data in complete isolation.

“Because a virtual computer isolates us from other users, a VPS provides far more freedom and flexibility than shared hosting.”
-excerpts from “Can You Use a VPS for Gaming?

The article “What is a VPS (Virtual Private Server)?” states: “As a result, a VPS is also sometimes referred to as a virtual dedicated server (VDS).

VPS offers several benefits, including high reliability, scalability, better privacy, root access to servers, and manageable monthly costs. As a result, it has extensive applications in transportation, healthcare, hospitality, e-commerce, telecommunication, and banking and financial services worldwide.

Getting Started with LightSail

In this demo, we will setup a WordPress website using LightSail. This will help us to see how simple it is to run web applications using LightSail by selection some options on a simple webpage.

Later in the post, we’ll also cover LightSail container service and will see a simple example of running a docker containerized .NET Core Web Application using LightSail Containers.

So, Lets get started.

You can access the LightSail dashboard from AWS Management Console and can get started immediately by clicking the Create Instance button:

This will start a very simple one-page Wizard where you can select few basic configurations such as instance location, instance image and few other options.

For example following screenshot shows the option selected for location and instance image:

Next, we can select which blueprint to use and you an see few popular options available in the following screen:

Now, if you don’t see your favorite application there, don’t worry. LightSail is a server at the end of the day and you have root access to it. So this shall not be a limiting factor.

For example, if needed, you can SSH to the instance and install necessary packages and can easily run .NET Core Web API application. You can also easily configure an NGINX reverse proxy in front of it and so on. Also running docker containers in LightSail is supported and you can imagine the possibilities. More on this later.

Back to our instance configuration, In next section, we have some options available to add a launch script to automate some initial setup and SSH keys and snapshots:

To keep things simple, we will not make any changes in this Optional section for this demo.

Next, we can choose instance plan as per our requirement and as you can see it is very easy to understand the cost and associated capacity:

Next, we can name the instance and add some tags for management purposes and once done, can click Create instance button as shown below:

and couple of minutes later, LightSail dashboard shows that our instance is running:

and if we now visit the public IP address of our instance, our WordPress website is up and running and accessible from any where on the internet:

It was a very simple process to get started with AWS LightSail. We selected few options on a simple webpage and were able to setup a running WordPress website in couple of minutes. This simplicity and with options to scale, is what make LightSail service an ideal solution for developers, medium-sized businesses, startups and similar use cases.

Exploring LightSail Instance

You can perform various instance management actions from the dashboard as shown below:

furthermore, you can find more information and various controls about your instance by clicking the instance card on the LightSail dashboard:

You can stop, reboot , or connect to your instance using SSH. You can add additional storage, see various Metrics graphs, Networking and other options. Go ahead and check various options and configurations.

You can delete instance, once instance is no longer needed. Otherwise it will cost you for the time it is running.

LightSail Container Service

Starting November 2020Amazon Lightsail offers a simple way for developers to deploy their containers to the cloud. All we need to provide is a Docker image for our containers and LightSail automatically containerize it for us. 

You can check AWS official website for step by step instruction on running containers using LightSail on this link.

Lightsail container services plugin makes it very easy to create your Lightsail container services, and create deployments using container images from an online public registry, such as Amazon ECR Public Gallery.

The processing of creating Lightsail container service is very similar to the server. Its a one page simple wizard to setup. I will not go into the details of this process as this is well defined in the above mentioned links. Following screenshot shows a container service created in LightSail dashboard:

You can check more details by clicking the card:

As you can see that you can deploy containers from A public registry or directly from your development machine.

I have a very simple .NET Core Web API application with following docker file:

You can access the source code on this git repo. Also, I am using .NET Core Web API application for the demo but you can instead use NodeJS or Java based application and principals will be the same.

So, I simply build the docker image using docker cli on my machine and used the following command to push it the Lightsail container service:

aws lightsail push-container-image --region eu-central-1 --service-name container-service-1 --label dotnettokengen --image dotnettokengen

We can see the stored images on LightSail dashboard as shown below:

and we use images to create deployments as shown in screenshot below:

once deployed, we can access the application via public domain. Following screenshot shows API call to .NET Core Web API Controller:

So, this was a very basic demo of the container functionality available in LightSail. Please check the official website for more details.

Summary

Amazon LightSail is a Virtual Private Server. It is a flat-rate, low-cost computing solution with easy setup and low maintenance. It is a scale-down version of EC2 which is ideal for developers, enthusiasts and small teams.

It offers various options to start with such as Bare metal ubuntu servers or create servers from one of the base images and applications bundled with an OS, so you don’t have to install them manually.

LightSail includes a number of subservices to help create simple architectures. There is a lot offered by LightSail, we haven’t covered yet in this introductory post, such as It supports snapshots, which are “Points in time” copy of entire instance. You can spin-up multiple instances using these snap shots and place a load balancer in front of those instances for better availability and scalability purposes.

You can create and connect databases easily with LightSail. VPC peering is another option supported by LightSail to extend networking reach and it also integrates well with AWS Route53 DNS service, Static IPs are supported and LightSail can also integrate with CDN to speed up content distributions.

Let me know if you have some questions or comments. Till next time, Happy Coding.

References

1 thought on “Amazon LightSail – Virtual Cloud Server”

Comments are closed.