How to set up and run a virtual machine on Amazon Web Services

Step 1: Create an AWS account

Step 2: Choose an Amazon Machine Image (AMI)

Finding and launching an AMI through the AWS Marketplace

Finding and launching an AMI through the AMI menu in AWS

Step 3: Launch your first instance to customize the AMI

Step 4: Connect to your instance and customize your AMI

  1. In FileZilla, click on “File”, then “Site Manager”.
  2. Click “New site” on the bottom left and give it a name.
  3. In “Host”, paste the Public DNS of your instance.
  4. For “Protocol”, select “SFTP”.
  5. Write “ubuntu” in the “User” field.
  6. For “Logon Type”, select “Key File”.
  7. Click “Browse”, navigate to the “.pem” file you saved earlier (Filezilla may default to looking for “PPK files”, so switch it to “PEM files” if you don’t see your key where it should be).
  8. Click “Connect”.
  9. Select the “Trust this Hostkey” checkbox and click “OK” when you see the “Unknown host key” warning.
  1. Click on “Quick Connect” (Alt+Q).
  2. In “Hostname”, paste the Public DNS of your instance.
  3. Write “ubuntu” in the “User” field.
  4. Under “Authentication”, de-select everything except “PublicKey”.
  5. Click on “PublicKey” (not the checkbox) to highlight it, then click “Properties”.
  6. Select “Use session public key setting”.
  7. Click “…” under “Use identity or certificate file” (which should be selected) and navigate to the “.pem” file you saved earlier.
  8. Click “OK” and then “OK” again.
  9. Double-click on the new session & “Accept & Save” when the host key warning comes up.
  1. sudo -s (this makes you a superuser)
  2. cd /tmp/
  3. mkdir statafiles
  4. cd statafiles
  5. tar -zxf /home/ubuntu/Stata16Linux64.tar.gz
  6. cd /usr/local
  7. mkdir stata16
  8. cd stata16
  9. /tmp/statafiles/install

Step 5: Save your updated AMI

Step 6: Launch a Spot Instance and do your work!

Final notes

Future adventures

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store