1. AWS EC2 Instance Creation & Swift Setup

Instance Creation:

As first step, you need an instance (aka “virtual server” or just “server”). Please go to your Amazon Web Services EC2 Console and launch the EC2 instance “Ubuntu Server 16.04 LTS (HVM), SSD Volume Type”.

There are many different Amazon Machine Images (AMIs), you can search for that particular AMI in the North Virginia region (US-East1) via its name "ami-40d28157".

For a quick test a t2.micro instance with 20 GB SSD is enough, especially if you put it behind a CDN like we actually do — but that is explained maybe in follow-on article.

Anyway, with your new instance please create a new security group which opens port 8080 to world and add your current IP for SSH. Later you need to change the port 8080 setting to just be accessible by the load balancer’s security group. But more on that further down below.

Initial Instance Setup:

When your new instance is up & running, connect to it via SSH (instructions for that you get in the EC2 console when you activate that instance and click on “Connect”).

Now you update the server, install auto-upgrades and a time service and finally initiate a reboot. Select “Yes” if a colored window appears:

After some seconds please re-connect to the instance via SSH as ubuntu user to install Swift & Vapor with the following lines:

You can now check if Swift was properly installed, where its binary is located and if it is generally compatible with Vapor:

And finally, you need to install Vapor Toolbox which is helping with building Vapor projects more efficiently with that single line of code:

You have now created an EC2 instance with Ubuntu 16.04, Swift 3 and Vapor properly installed. Maybe now is a good time to create a snapshot :)