Last few days I have been working with Amazon Web Services micro instance free tier, this post I want to explain how to setup instance, elastic IP configuration, cloud instant accessing from local computer using Putty and FTP connection. It’s awesome real cloud computing, you have complete control on server, using this we can implement new web features like node.js. Soon I’m hosting all of my demos into EC2.

Getting started with Amazon Elastic Compute Cloud(EC2)
Amazon providing 720 hours free tier micro instance box. Very first you have to create an account in Amazon.com with valid credit card and then activate micro free tie. Click here to access Amazon console dashboard.

Step 1
Go to left panel EC2 Dashboard -> NETWORK & SECURITY -> Key Pairs

Creating Key Pair - Authentication
Most important part in this installation process. Click Create Key Pair button.Step 2

Step 3
Give some key pair name. Eg:9lessons

Step 4
9lessons key pair has been created.

Step 5
You will get download save alert, save the .pem signature file into local directory Eg: D:/.

Step 6
Amazon EC2 dashboard will show created Key Pair and Fingerprint.

Security Groups -> Firewall
Step 7
By default Amazon providing default security group, I recommend use the default firewall or you can create new security group like eg: Egglabs.

Default firewall allowed ports.

Step 8
If you want you can allow new port by adding here

Instance -> Cloud Box
Step 9
Create instance here EC2 Dashboard -> INSTANCES -> Instances

Step 10
Here you have to choose cloud server OPERATING SYSTEM.

Step 11
You can search in Community AMIs. Start icon references to free tier for Micro box users.

I had selected Ubuntu Natty Operating System 11.04 server.

Step 12
Instant details you can give any name.

Step 13
Now you have to choose type of instance small,medium and large. Amazon providing Micro (Free tier) 30 days

Step 14
Here you have to select 9lesson key pair by selecting Your Existing Key Pairs

Step 15
Configure firewall choose default security group.

Step 16
Now you instance cloud compute ready.

Step 17
Go to Amazon EC2 dashboard, here you can seen instance box running. You can edit the instance box name.Eg:SrinivasBox

Step 18
Right click on the running instance and click connect.

You will get connecting help alert.

Elastic IP
Amazon EC2 instance only providing public DNS name, If you reboot existing instance box the public DNS name will change, using Elastic IP we can solve this problem DNS problem it's static.Step 1
Clicking on Allocate New Address, amazon will provide you dedicated IP address.

Step 2
Choose EC2.

Step 3
Amazon generated an IP address, now map IP address to Instance box (Eg:SrinivasBox). While clicking on Associate Address button.

Step 4
Associate instance and click YES button.

Linux connect
Executing following command in Linux terminal you can directly access your box.ssh -i KEY File username@publicDNSname.amazonaws.com
ssh -i 9lessons.pem ubuntu@publicDNSname.amazonaws.com
ssh -i 9lessons.pem ubuntu@publicDNSname.amazonaws.com
Windows connect using Putty
PuTTY is a free and open source terminal emulator application which can act as a client for the SSH, Telnet, rlogin, and raw TCP computing protocols and as a serial console client. Step 1
First you have to download Putty.exe and PuttyGen.ext into your PC click here and download

Step 2
Run PuttyGen.exe click Conversions -> Import Key.

Step 3
Choose 9lessons.pem the Key Pair.

Step 4
In Parameters select Type of Key Generate SSH-1(RSA). Click Save private key.

Same directory Puttygen will generate .ppk file (private key).

Step 5
Now run Putty.exe host name give Elastic IP or Public DNS name(If no elastic IP) and choose connection type SSH

Step 6
Authentication with private key.
Category -> Connection -> SSH -> Auth browse and select .ppk file the click Open button.

Step 7
Instance cloud connected successfully.

Execute following commands.
Update the Package
sudo apt-get update
Install Apache2
sudo apt-get install apache2
Install PHP5
sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo apt-get install libapache2-mod-php5
Install MySQL
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
Install PhpMyAdmin
sudo apt-get install phpmyadmin
Restart Apache2
sudo /etc/init.d/apache2 restart
Now your web services is ready. You can upload your files into /var/www/ directory using FTP.
Access http://ElasticIP/. It works!
FileZilla - File Uploads
Using the open source FTP tool you can upload files into Amazon EC2 instance box. Download here and install into your PC.Step 1
Select File-> Site Manager

Step 2
Give host name as your instance box Elastic IP and select Server Type SFTP-SSH File Transfer Protocol. Click OK not Connect

Step 3
Adding private key for instance cloud authentication. Edit -> Settings -> Connectin -> SFTP click Add keyfile button to browsed and choose existing .ppk file. Eg:9lessons.ppk


Step 4
Now Got File-> Site Manager click Connect button.

Instance connected.

Now you can upload files from local PC to Amazon EC2 Instance Cloud /var/www/ directory.

Hope you like it. Thanks!
Srinivas Tamada














Really nice article Srinivas. I liked that attention to detail in this article. Good work. Keep it up.
Thanks for sharing.
Vishal
@Vishal
Thank you
Nice Work Man
why do you use amazon web services. i'm not familiar this service. is it a standart web hosting service? why is it used?
Thank you
Thanks a lot. Great Article.
Nice post srinu, thank you for sharing ...
very nice Srinivas! :) can u do node.js in the future :D
Thanks. good article !
Excellent !!!!
I was looking for it !!
Thanks. Good one.
Great Srinivas :)
I am happy to see article of my choice ;)
Thanks
Hi, for some reason I can't see anything on browser, is everything setup and running ok, but when I'm try to access get an error
Nice tutorial. I just wish I had it when I set up my micro instance a few months back! ;-)
thanks for this post!
I did all the steps, but I couldn't get beyond
Step 6: Authentication with private key. When I click open, the cmd pops up and after sometime it says "Network Error: Connection timed out"
Any help on this?
Hi Srinivas
I have successfully setted up everything as instructed in this article but my elastic IP does not work in browser! Is there anything I will be missing here!
Thanks,
Vishal
Hi Srinivas,
Just for your reference, if anybody else encounters this. I had two issues while setting up EC2.
1. I was not able to SSH into my EC2 instance via Putty. To resolve this, I had to add Port 22 in my Security Group (Port Range field)
2. I was not able to make http request via my elastic IP. To resolve this, I had to add port 80 in my Security Group(Port range field) which fixed the issue.
Vishal
Wow... that is complete article. I'm happy to subcribe your newsletter.
I'm new to this, the lack of this article is to describe what for/final goal we rent service in amazon EC2. Is it to host file for download, to make complete hosting etc?? i hope you explain this for the future newsletter, it can easily read for entire level.
btw, can we make our hosting to host website using amazon EC2, sell reseller space etc??
Srini....Thanks a lot....This tutorial helps me, to establish the key pair ssh connection in my rackspace cloud server.
Thanks Again,
Your articles are RELEVANT and VERY straight to the points.
Simple and clear , I thought setting EC2 is hard. But you made it to pieces.I gonna Share this article in my tuts blog :)
Nice tutorial.. I am unable to connect.. I followed exactly mentioned in this tutorial, but still can't connect using putty
Neat post. Good job. Looking forward to more posts...
Thank you for sharing. :)
Great post. Thank you.
good one..you covered everything..
i was not able to connect into my FTP. Srinivas can you help with it.
How many Instance EC2 , we can create FREE ?
720 Hours
1 instance EC2, can run 720 hours FREE per month with 10GB Space, 15 GB traffic.
But i see, we can create many and many instance EC2 and create over 10GB Space without any alert from Amazon.
So, I don't know they will charge us or not.
But when we create more Instance EC2, they still show us Free Tier on micro :D
This is really a very useful and unique post about this topic. Saved my lot of time. Thank you very much for sharing.
Wishes!!
Going to try the free version for sure :)
Thanks dear
thanks , amazing post .
how can i use my own domain name on Amazon EC2 ?
Thanks a lot
great article
THANKS
Excellent Article Srinivas. We are planning to migrate to amazon and this would be really helpful.
Really great article Srinivas!!! Thanks a lot!
THIS WAS SO HELPFUL.
Most documentation online has not been very clear but following these steps worked great