{"id":7141,"date":"2017-11-28T08:41:57","date_gmt":"2017-11-28T00:41:57","guid":{"rendered":"http:\/\/rmohan.com\/?p=7141"},"modified":"2017-11-28T08:41:57","modified_gmt":"2017-11-28T00:41:57","slug":"installing-node-js-on-amazon-ec2-instance","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=7141","title":{"rendered":"Installing node.js on amazon EC2\u00a0instance"},"content":{"rendered":"<div id=\"page\" class=\"hfeed\">\n<div id=\"main\">\n<div id=\"primary\">\n<div id=\"content\" role=\"main\">\n<article id=\"post-188\" class=\"post-188 post type-post status-publish format-standard hentry category-aws tag-aws tag-ec2 tag-node tag-node-js tag-nvm tag-pm2 tag-server\">\n<div class=\"entry-content\">\n<p>Launch an EC2 instance of type Amazon Linux AMI from your aws console.<\/p>\n<p>SSH into your ec2 instance<br \/>\n<code>ssh -i ec2-user@my_ec2_ip_address<\/code><\/p>\n<p>Update the instance<br \/>\n<code>sudo yum update -y<\/code><\/p>\n<p>#install developer tools<br \/>\n<code>sudo yum groupinstall -y \"Development Tools\"<\/code><\/p>\n<p>Install the node\u00a0using <a href=\"https:\/\/github.com\/creationix\/nvm\">nvm<\/a>\u00a0as it allows you to switch between any version of the node ????<code><br \/>\ncurl -o- <a href=\"https:\/\/raw.githubusercontent.com\/creationix\/nvm\/v0.32.0\/install.sh\" rel=\"nofollow\">https:\/\/raw.githubusercontent.com\/creationix\/nvm\/v0.32.0\/install.sh<\/a> | bash<br \/>\n. ~\/.nvm\/nvm.sh<br \/>\nnvm install 4.4.5<br \/>\nnode -e \"console.log('Running Node.js ' + process.version)\"<br \/>\n<\/code><\/p>\n<p>Install <a href=\"https:\/\/github.com\/Unitech\/pm2\">pm2<\/a><code><br \/>\nnpm install pm2 -g --save<br \/>\n<\/code><\/p>\n<p>pull the source code in ec2 instance. run your node app using pm2<br \/>\n<code>pm2 start app.js --name=\"api\"<\/code><\/p>\n<\/div>\n<\/article>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\n<p>Launch an EC2 instance of type Amazon Linux AMI from your aws console.<\/p>\n<p>SSH into your ec2 instance ssh -i ec2-user@my_ec2_ip_address<\/p>\n<p>Update the instance sudo yum update -y<\/p>\n<p>#install developer tools sudo yum groupinstall -y &#8220;Development Tools&#8221;<\/p>\n<p>Install the node using nvm as it allows you to switch between any version of the node [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7141"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7141"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7141\/revisions"}],"predecessor-version":[{"id":7142,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/7141\/revisions\/7142"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}