The first step in deploying the Todo application is creating a MEAN stack instance in Lightsail. When creating the instance, you will supply a Lightsail launch script to actually install the application.
From the Lightsail console home page click Create Instance
Make sure that Linux/Unix is selected under Select a platform, and then under Blueprint choose MEAN
Click +Add Launch Script
Paste the script below into the text box
#! /bin/bash sudo /opt/bitnami/ctlscript.sh stop apache sudo mv /opt/bitnami/apache2/scripts/ctl.sh /opt/bitnami/apache2/scripts/ctl.sh.disabled cd /home/bitnami sudo git clone https://github.com/mikegcoleman/todo cd /home/bitnami/todo sudo npm install --production sudo cat << EOF >> /home/bitnami/todo/.env PORT=80 DB_URL=mongodb://tasks:tasks@localhost:27017/?authMechanism=SCRAM-SHA-1&authSource=tasks EOF
This script does the following:
Name the instance MEAN
Once the instance shows a state of running in the Lightsail console, SSH into it either using the built in SSH client or using your own (username: bitnami). If you are unfamiliar with SSH please visit the prerequisites page.
Even though the instance shows a state of running, it may still be executing the startup script, and you won’t be able to connect. If this is the case, give it a couple of minutes and try again.