If you are new to AWS and looking to deploy some servers for your applications then AWS Lightsail may be the best starting point for you.
Unlike Amazon EC2, you are given a nice interface where you can select preconfigured plans that may cover most of your use cases.
Just with 3–4 clicks you can launch a WordPress website running on Linux server.
You also don’t have to worry about determining the cost since the cost is fixed monthly.
Along with servers, you can also create databases, load balancers, and storage on Lightsail.
Now let’s get practical and quickly launch a Node server with Lightsail!
Launching an Instance
- First, log into your AWS console and in the All Services tab under Compute you will find Lightsail. Click on it, it will open the Lightsail dashboard in a new tab.
2. Now you can select the region in which you want to create your instance (server). Normally, the closer your instance is to your users, the lower is the latency and faster is the connection. Here, I have selected the Mumbai region since its closest to my location.
3. Next step is to select the instance image (OS and application). For the Linux platform, you can either select only OS where you have the option to choose from Ubuntu, OpenSUSE, CentOS or Amazon Linux.
Or you can select an application along with OS. When you select an application, AWS automatically installs all the necessary packages and files needed to work with that application so you don’t have to install them yourself.
For Windows Server, currently, the only available app is SQL server.
For the Apps, I will be selecting Node.js here, you can select anything else if you like.
4. In the optional section above you can add a launch script, this is a shell script that will run on the instance the first time it launches. If you have deployed an EC2 instance in the past then you may recall that it resembles with the User data there.
You can use this script to do some configuration on the instance.
By default, Lightsail uses a default ssh key pair for your Linux instances. You can use this ssh key to connect to your instance using SSH via command line.
Now, its time to choose an instance plan. You can see the different fixed price available plans. If you are trying for the first time then you can use the first plan worth $3.5 free for one month.
5. You can give your instance a unique name if you would like.
You can also give tags to your instances to easily filter them or organize them for billings and analysis purposes.
Now click on Create Instance button to create your first Lightsail instance!
Within a few minutes, your server will be deployed and you will see something like above. Click on it to view additional details.
You can see that the status is running and just below it you can see the Public IP of the instance. If you paste it in the address bar of your browser it will show you a similar page like below.
Now you can SSH into your instance and deploy your code.
Don’t forget to terminate your instance if you are not using it anymore. You can terminate the instance by going to the Delete tab in the above screenshot.
If you want to learn how to SSH into your instance and upload your code, you can check out the following article Deploying a Node App on Amazon EC2.
If you have any questions, please comment below.
Thanks for reading this article. If you liked it, please give a few claps so it reaches more people who would love it!