Sunday, 10 December 2017

Deploy Angular4 application on an ec2 instance


Here are the some easy steps to deploy an angular4 application into an ec2 instance


  • install angular-cli
    •  sudo npm install -g @angular/cli

  • node with version greater than 6 must be installed 
    • see my last post describes to setup an node application
  • Port should be open from security group inbound rules.
  • Clone the repo:-
  • Run: 
    • npm install
  • serve to required port and public ip
    •   ng serve --disable-host-check --host 0.0.0.0 --port 3100  --public  xx.xx.xx.xxx
  • Run in background 
    • Start a client
      • nohup ng serve --disable-host-check --host 0.0.0.0 --port 3100  --public  xx.xx.xx.xxx  1>./log.txt 2>./err.txt &
    • Stop a client 
      • kill $( lsof -t -i:3100)
    • Or by using screen

No comments:

Post a Comment