AWS Lightsail + NodeJS

From ESE205 Wiki
Revision as of 21:24, 19 September 2018 by Ethanshry (talk | contribs) (→‎Getting your code running on the server)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

This tutorial will cover using AWS Lightsail as a cheap and easy alternative to EC2 for hosting a server in AWS.

Materials/Prerequisites

This tutorial assumes you have an AWS account already. If you do not, go ahead and create an AWS account here

Process

About Lightsail

Lightsail is essentially a simplified version of AWS EC2- there are fewer server tiers, a simplified pricing model, and more preconfigured server distrobutions than EC2.

Spin up a Lightsail Instance

Navigate to Services > Lightsail

Click Create Instance

Leave the availability zone to default. Ensure that your platform is Linux/Unix, and then select the Node.js bluprint in the App + OS blueprint section.

Ensure you select the cheapest price per month instance, since you shouldn't need anything larger than that.

Finally, give your instance a unique name and click Create.

Your instance may take some time to spin up. Once it's finished, click on it to open its settings.

You'll notice that you have a Public IP. If you enter it into the browser, you should see a page by bitnami of some sort- congratulations, you've successfully spun up a server.

Configure Static IP

By default, your IP address will change whenever the server reboots. To change this, we will create a static IP for our instance. navigate to the Networking tab of your instance, and under IP Addresses > Public IP click Create static IP.

Finally, go back to your instance's main page and click 'Connect using SSH. This will open a browser session SSHing into your instance.

The first time, you should update and upgrade all your server's packages. In your SSH terminal, run sudo apt update && sudo apt upgrade -y.

Getting your code running on the server

Basically, just follow the instructions here: https://medium.com/@sharmasha2nk/aws-lightsail-bitnami-nodejs-letsencrypt-cf653573b8a1

Authors

Ethan Shry, Fall 2018

Group Link

N/A

External References

N/A