Skip to content

Amazon Web Service Guide

Greg Kostin edited this page Mar 28, 2018 · 40 revisions

What is difference between Lightsail and EC2?

  1. Create Instance
  • Instance location: Ohio, Zone A
  • Select a platform: Linux/Unix
  • Select a blueprint: OS Only Ubuntu 16.04 LTS
  • Add launch script:

#!/bin/bash

#using export is important since some of the commands in the script will fire in a subshell
export DEBIAN_FRONTEND=noninteractive &&
export APT_LISTCHANGES_FRONTEND=none &&

echo "executing autoremove" &&
apt-get -fuy --force-yes autoremove &&

echo "executing clean" &&
apt-get --force-yes clean &&

echo "executing update" &&
apt-get update &&

echo "executing dist-upgrade" &&
apt-get --force-yes -o Dpkg::Options::="--force-confold" --force-yes -o Dpkg::Options::="--force-confdef" -fuy dist-upgrade

echo "install git-core" &&
apt-get --assume-yes install git-core &&

echo "switch user ubuntu" &&
su ubuntu << 'EOF'
cd ~
git init
git remote add origin https://github.com/gkostin1966/heliotrope.git
git fetch
git checkout -t origin/aws
EOF &&

echo "swap rc.local" &&
cat /etc/rc.local > ~ubuntu/aws/rc.local.root &&
cat ~ubuntu/aws/rc.local.ubuntu > /etc/rc.local &&

echo "reboot" &&
reboot

  • Change SSH key pair: Default << Download >>
  • Choose your instance plan: $5 month USD
  • Name your instance: Ubuntu-512MB-Ohio-1 x 1

<< Create >>