Check out this Cloud Lab to learn more about Amazon Lightsail.
Amazon Lightsail is an infrastructure as a service (IaaS) offering by AWS that enables users to spin up a virtual server with a preconfigured environment for a predictable price. This blog attempts to answer when you would use Lightsail and what exactly it has to offer. Lightsail makes it easy to create a virtual machine with a predictable monthly price, providing an easy-to-use platform for developers, small businesses, and students to quickly deploy and manage cloud infrastructure without the complexity of traditional cloud services.
One of the most common web development stacks is MERN. Imagine that you want to deploy your website based on the MERN stack. What are your options? You could choose from a shared or virtual private server (VPS) hosting provider like Hostinger or cloud virtual machine hosting like AWS EC2. Shared hosting has the lowest price point, whereas the VPS hosting option can be considered in the moderate price range. The EC2 option price is variable since it is billed according to usage.
The benefit of EC2 in this scenario is that it provides us with virtually unlimited scalability, whereas the shared and VPS hosting options provide limited scalability. With EC2, you also have much control over the infrastructure, with the added responsibility of using it wisely. With shared and VPS hosting, you have limited control over the infrastructure since most of it is preconfigured. Being preconfigured makes shared and VPS hosting easier to use compared to EC2. So, at one end, there is the ease of use and cost predictability of shared hosting, whereas at the other end, we have the flexibility of offerings like EC2.
Many cloud adopters often end up paying more than anticipated costs when they switch to EC2 due to factors such as improper instance size and wrong purchase options.
Lightsail brings the flexibility of cloud computing with predictable pricing. You get the preconfigured templates for ease of use. You get the ability to scale your deployment. At the same time, you have predictable monthly pricing. Currently, a single-core Linux virtual machine with 512 MB of RAM, 20 GB of SSD storage, and 1 TB of data transfers costs 5 USD monthly. A beefy 8-core Linux virtual machine with 32 GB RAM, 640 GB SSD storage, and 7 TB data transfer costs 164 USD per month. Also, there is even a limited-time offer to get the first 90 days for free at the time of writing.
For further pricing details, please visit the AWS Lightsail pricing page.
Deploying a MERN stack application is great, but in what other scenarios would Lightsail be a good choice? Here’s a list of some other common use cases:
Development environment: Software developers can use Lightsail to spin up a development or testing environment in the cloud and focus on coding.
Experimentation: Thanks to the affordable pricing, small teams can use it for low-stake experimentation.
Content delivery network (CDN): It can even be used as the origin server for a CDN.
Mobile application backend: We can even use a Lightsail server as a backend for mobile applications.
Web backend: We can use multiple Lightsail instances, one for each service that runs in a web application. For example, separate database and web servers.
Scalability: Lightsail isn’t only for the simplest of applications. We can create complex and highly available applications using load balancers and multiple instances. If our application storage requirements grow, we can even attach external block storage later.
Research: There’s even a Lightsail for research, which allows academics and researchers to create virtual machines with commonly used research software (such as RStudio and Scilab) preinstalled.
Let’s explore some features of Lightsail that make it an attractive choice for developers.
Lightsail provides virtual machines with varying hardware specifications and many different operating systems. Lightsail offers common preconfigured software development stacks like Node.js, MERN, Django, and LAMP. It also has options for preinstalled e-commerce and project management applications like Magento and Redmine. We can also spin up instances with a preinstalled CMS like Joomla, Drupal, or WordPress, which makes creating websites a breeze.
Lightsail also provides its object storage named bucket. You can create a bucket for static assets used by your web application. This creates a separation of static assets from the application itself. You can also use a bucket for backup and restore of your application.
Lightsail also provides a container service. It simplifies deploying and managing a containerized application than the more complex container orchestration services. It easily integrates with other Lightsail services like load balancers. This service is a low-friction way to try out containerized application deployment on the web.
Let’s see how easy it is to create a preconfigured instance in Lightsail.
Step 1: We head over to the Amazon Lightsail dashboard. We will be greeted with a message and informed of the number of instances running, if any. On the left, we’ll notice that the “Instances” menu (highlighted in the slide with a red rectangle) is selected by default. Click the “Create instance” button (highlighted with a rectangle with a dotted outline).
Step 2: We’ll land on the “Create an Instance” wizard. The first section allows us to select the location where our instance will be created. We sometimes need to select an appropriate region based on proximity to the users. The next two sections allow us to pick an operating system and runtime. Slightly below this (not shown in the slide deck) is an “Optional” section where we can specify a script to be run on the instance once it is launched using the “Add launch script” button. This helps apply initial configurations, such as bootstrapping a database server with initial data.
Step 3: As we scroll down in the wizard, we’ll be prompted to choose an instance plan. By default, AWS is offering a “Dual-stack” machine, meaning that it has IPv4 as well as IPv6 support. Next, we can choose an instance size, which affects the monthly pricing.
Step 4: Scrolling further, we can identify our instance with a unique name. We are also allowed to create multiple instances with identical configurations. This could be useful for high availability. Next, we have some tagging options to help identify and distinguish our instances. For instance, we could create and assign different tags to development and production machines. Once satisfied with the selections, click the “Create instance” button (highlighted with a red rectangle).
Step 5: We’ll arrive at a page that displays a greeting and informs us that the creation of the instance is “pending.” In a few minutes, the instance will be deployed and available.
Step 6: Soon, once the instance is ready, the cube’s color in the instance state will change to green, and we’ll be able to see its IP addresses as well. We can use these to connect to the running web application or to the instance via SSH.
We hope that this blog has piqued your curiosity. If you like the convenience and price point that Lightsail offers, play with the service by creating various scenarios involving load balancers, database servers, or machine learning distributions. Our Cloud Labs product is very popular among our learners for providing a to-the-point and hands-on, right-sized learning experience without having to sign up for an AWS account. Happy learning!
Frequently Asked Questions
What is the difference between Amazon Lightsail and AWS Lambda?
What does Amazon Lightsail do regarding backups?
What is the difference between Amazon Lightsail and Amazon EC2?
Which category of service does Amazon Lightsail belong to?
Free Resources