Skip to content

Demonstration to EC2 instance

AmiBhadani edited this page Mar 2, 2021 · 6 revisions

Steps to create EC2 instance and deploy application on server

  • Open amazon AWS EC2 console.

  • Click on launch instance.

    • launch instance
  • Select an Amazon Machine Image (AMI), ubuntu 20.04 .

    • ubuntu image
  • Select t2.micro instance type from list and click on next: Configure Instance Details.

    • step2
  • We are using default value for this step. Click on next: Add storage

    • step3
  • Select default value of 8GIB disk volume. Click on next: add tag

    • step4
  • Click on next: configure security group

    • step5
  • Choose review and launch

    • step6
  • Choose launch

    • launch
  • Create new key value pair and launch instance

  • Download private key *.pem file

    • key

    • view launch

  • Install putty on local machine.

  • In putty-gen, generate private key for downloaded *.pem file and save it.

    • gen key

    • save key

  • In AWS console select instance and assign elastic IP by following steps:

    • elastic ip

    • list of elastic ip

    • asossiate

    • eip instance

  • In AWS console set security group as below:

    • inbound rule

    • edit inbound rule

    • save inbound rule

  • Open putty and enter Host ip address and select SSH from left side panel, than select "auth" and browse to add the private key.

    • putty

    • puttyauth

  • Now you should be connected to server and access it.

    • putty ubuntu

    • cmd

    • server aptget cmd

  • Now install docker in your server(ubuntu)- steps to install docker in ubuntu

    • after installation of docker in ubuntu you should be able to access docker commands. For example, docker ps

    • cmd docker ps

  • On server run docker container from docker repository using command $ sudo docker run -it -p 3000:3000 abhadani/photosite

    • docker rrun on server
  • link to website running perfect!

    *running website

Clone this wiki locally