How to Setup Node and Express on Amazon Web Services EC2
Why Stack Overflow recommends it
Stack Overflow users link it when answering how to host a Node.js app on EC2, since it shows the whole flow from creating the instance to serving a page.
Recommended by 3 people across 3 different months, 2016 to 2018.
What it is
A 2014 screencast by MicrowaveSam that walks through launching an Ubuntu micro EC2 instance on AWS, opening security group ports, SSHing in with a pem key, compiling Node.js from source, and running a simple HTTP server and then an Express app. It also shows running Node as a background process with nohup.
What people said
Recommends Mohammed Gadiwala · 2016-06 · Stack Overflow · on “Which Amazon web service for Node Js server?”
For Node js EC2 service should be used. You have to install a software named putty configure it and run your node js script like you run on your localhost. Here are some links to tutorials: [this video] [LINK] To deploy files you can simply use FTP instructions given below: Connect to Amazon EC2 file directory using Filezilla and SFTP [LINK]
Recommends Adiii · 2016-12 · Stack Overflow · on “AWS Linux (Ubuntu) hosted application is not accessible from public ip”
MAke Your Instance in AWS first Enable inbound rule as u mention in picutre Enable user group after ssh connection with AWS ubuntu instance once instance start running then Install node properly sudu apt-get update sudo apt-get install libssl-dev g++ make download source code of node from web node.tar.gz wih command wget link [LINK] tar -xvf node -v0.10.32.tar.gz now goto node after unzip .gz ./configure && make && sudo make && sudo make install boom your node server is ready on new AWS instances or watch this [this video]
Recommends Noam Manos · 2017-02 · Stack Overflow · on “hosting nodejs application in EC2”
Based on this tutorial [this video] , here's an updated step by step: 1) Make an account on Amazon Web Services [LINK] . 2) Create an EC2 instance; I chose Ubuntu micro. 3) Configure Security Group (name it "Node") and add ports: HTTP (80), HTTPS (443), and a custom TCP port for your Node app (e.g. 3000) 4) Launch the instance and save the pem file (private key), e.g. "node.pem". 5) On Windows - install Cygwin [LINK] + OpenSSH package. it is also recommended to install WinScp [LINK] to have "explorer like" access to the linux. 6) Open Cygwin Terminal as Administrator, and set correct permissions to "node.pem" file: chown :Users node.pem chmod 400 node.pem 7) Find your EC2 instance public DNS name
Cites Florian Ludewig · 2018-11 · Stack Overflow · on “Redirect Port via iptables on AWS EC2 Ubuntu instance”
I have a running AWS EC2 instance on an Ubuntu machine running a Nodejs server. Everything works fine then opening the website via its public ip on port 3000 likes this: [LINK] Now I want to redirect all requests from port 80 to this port 3000 via iptables like described in this video: [this video] via sudo iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000 . Unfortunately I am getting this error: [LINK] when opening the site like this: [LINK] (without port 3000 specified) P.S.: I'm not really sure if my approach is correct. I am open to other ways of achieving a redirect from port 80 (http) to port 3000 As @Vorsprung suggested I should use an Application Load Bala