They are many companies which offers cloud-services like AMAZON, GOOGLE, RACKSPACE , MICROSOFT , AT&T and so on. Now i am going to share how to run your application on ec2 instance (server) on aws. You can register for 12 months free tier AWS account .once your account is created login into your console . To create ec2 instance and launch your application you need to follow below steps:
- Launching the instance.
- Connecting to instance.
- Launching your application.
#1.Launching the instance amazon web server
- Login into the AWS Console , In the dashboard top left corner ( navbar) click on services drop-down and select ec2 option.
- you can launch your instance in desired location by selecting on the top navbar right side as show in the image.
- Click on instance in the left side panel and click on launch button.
- Now the actual process goes on seven steps. In Step 1 ( choose Choose an Amazon Machine Image) you need to select the machine on which you application what to run. Please select anyone of AMI (NOTE : Here i am going to show you Amazon Linux AMI , Ubuntu Server 16.04 and Ubuntu Server 14.04 ).
- In Step 2 (Choose an Instance Type ) based on the storage and data-transfer of your application, by default t2.micro is selected. choose types of instance and click on next button
- Step 3 ( Configure Instance Details ) in this you can select the number of instance ( you can also set-up auto-scaling ) Network settings ,IAM role , Shutdown behavior and more. Keep all the settings as default if you don’t know anything and click on next button
- Step 4 ( Add Storage ) Enter the storage capacity required for your application by default it will 8GB and click on next button
- Step 5 ( Add Tags ) you can add as number of add the tags as you want.you could define a tag with key = Name and value = Web-server and Tags will be applied to all instances and volumes
- Step 6 ( Configure Security Group ) A security group is a set of firewall rules that control the traffic for your instance, you can add rules to allow specific traffic to reach your instance. If you want to set up a web server and allow Internet traffic to reach your instance, add rules that allow unrestricted access to the SSH, HTTP HTTPS and MYSQL ports as shown below and click on review and launch
- Step 7 ( Review Instance Launch ) Its like summary of all the above six steps you done above if everything is fine click on launch button. Now a pop-up box appears asking you to Select an existing key pair or create a new key pair since you are launching for first time select create a new key pair in the dropdown as shown in the image below and enter the key name ( key name can be any name ) NOTE: You have to download the private key file (*.pem file) before you can continue. and finally click on launch button