Deploy a Node.js App on EC2
Install Node.js, deploy your app, and run with PM2.
12 min
Deploy a Node.js application on your Feed Forge EC2 instance.
Steps
- SSH into your EC2 instance.
- Install Node.js 20 LTS.
- Clone or upload your project.
- Install dependencies and start with PM2.
Code examples
# Install Node.js 20
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Deploy app
cd /var/www/myapp
npm install
npm install -g pm2
pm2 start app.js --name myapp
pm2 save && pm2 startup