I have been managing Linux Virtual Servers for well over 10 years. I visited the AWS offering many times before taking the plunge. Their huge variety of server options, storage options, bandwidth options, etc made their offering very confusing. Since I did not understand which options I would need, I could not determine what costs to expect. Let’s review the total cost associated with a small Debian server on AWS and walk through setup of that server.
Server (EC2 t2.micro w/ 1GB ram): $162 ($109 initial + $1.46/mo)
Storage (EBS SSD 30GB): $108 ($0.10/GB/MO)
Outgoing Bandwidth (540GB): $49 ($0.09/GB)
Incoming Bandwidth: FREE
Static IP (Elastic IP): FREE
TOTAL 3-YEAR COST: $319 ($109 initial + $5.83/month)
AWS offers a free tier that provides all new customers with the server/storage/bandwidth configuration shown above one (1) full year.
Personal Setup Instructions
- Create a new AWS account and login to the account.
- Drill-down to the EC2 services control panel.
- Click “Launch Instance”
- Choose an Amazon Machine Image (AMI) – This is a prebuilt OS image. I typically go to the “Community AMI” page, search for “Debian amd64 hvm”, and click “Select” next to the most recent AMI listed.
- Choose an Instance Type – These are your server specs. Let’s choose the smallest (cheapest) instance type, currently “t2.micro” with 1 CPU and 1GB of RAM. Click Next.
- Configure Instance Details – “Enable Termination Protection” should be enabled, to protect your instance from accidental “Termination” (deletion). The rest of the default settings are fine for now. Click Next.
- Add Storage – Configure your server disk size here. By default, disk size currently defaults to 8GB on a General Purpose (SSD) drive. Increase the disk size if you’d like, otherwise accept defaults and click Next.
- Tag Instance – We will not create any tags. If you use AWS for multiple customers or projects, you can use tags to classify resources by customer, by project, etc. which can be helpful for billing and overall management. Click Next.
- Configure Security Group – This page allows you to create basic firewall rules. By default, you will create a new security group allowing SSH access from ANY IP. Accept the default for now and click Next. You can easily edit your Security Groups (firewall rules) later.
- You have an opportunity to review your settings. Click Launch.
- Key Pair – Create a new SSH key pair and download the keys. You will use this SSH key pair (instead of an SSH password) to login to your AWS server. Click Next.
- Congrats! AWS is building your new server! The server should be ready for use in less than a minute.
- Go back to the AWS console, drill-down to EC2, and click on “Instances”. Your new server should be listed. Click on your new server to view server details, including “Public IP”
- SSH into your new server!
- GUI – If you are using a GUI such as PuTTY, the SSH hostname will be the “Public IP” (e.g. 10.9.8.7) shown in your server details and the username for your Debian server should be “admin”. Be sure to tell the GUI to login using your private key.
- CLI – Assuming “Public IP” is “10.9.8.7” and you saved your SSH key to “private.key”, you would run the following command: “ssh -i private.key email@example.com”
- Update your Debian OS (e.g. “sudo apt-get update” and “sudo apt-get upgrade”)
- Oops! The OS cannot access the internet! You need to allow outbound traffic in your Security Group. Let’s edit your outbound firewall rules…
- Go back to the AWS console, drill-down to EC2, and choose “Security Groups”
- Click on your existing Security Group in the upper window pane, click on the “Outbound” tab in the lower window pane, and Add Rule to allow “All Traffic” to “Anywhere”. Click Save. Changes should take effect almost instantly (less than 5-10 seconds).
- Try to update your Debian OS again.
- You should be good to go at this point!
After your free year of service has ended, You need to decide which Instance size you plan to use (e.g. “t2.micro” or “t2.small”) and purchase a “Reserved Instance” (RI) for that Instance size to help keep your costs down. You are essentially pre-paying part of your hourly fee for 1 or 3 years in exchange for either a 30% or 50% discount, respectively.You do not link an RI to a specific instance. As long as you have an instance type running in the same “Availability Zone” (AZ) as the RI instance type and RI AZ, you will automatically receive the discounted hourly rate.
Amazon allows you to resell the unused months of your RI in their marketplace and recoup nearly all of the unused value (e.g. pay $109 for 36-mo “t2.micro” RI, receive around $50 if you sell 18-mo “t2.micro” RI on the market).