Deploy Your Full-Stack App on a single AWS EC2 Instance | ReactJs, NodeJs, Nginx and PM2 setup

Published: 05 September 2025
on channel: Ashutosh Verma
2,404
54

Want to take your full-stack project live on the internet? 🚀
In this video, I’ll walk you through the complete process of deploying a React frontend and Node.js backend on a single AWS EC2 Instance. We’ll set up Nginx as a reverse proxy, configure PM2 to keep the backend running.

If you have any issue in connecting the EC2 instance to terminal, watch my previous video where I explained in detail, the issues of SSH
   • Deploy React App to AWS EC2 – Full Setup i...  

By the end of this tutorial, you’ll have a production-ready app hosted on AWS, accessible from anywhere in the world.

🔹 What you’ll learn in this video:

Launching and connecting to an AWS EC2 instance
Installing Node.js, NPM, and Git on Ubuntu
Cloning your project from GitHub
Setting up environment variables with .env
Running the backend with PM2 (process manager)
Building and deploying the React frontend with Vite
Configuring Nginx to serve frontend and backend together
Fixing common errors like CORS and timeouts

🔹 Tech used in this tutorial:

AWS EC2 (Ubuntu)
Node.js + Express backend
React (Vite) frontend
Nginx reverse proxy
PM2 process manager

This is a step-by-step guide, perfect for beginners who want to learn how to host a full-stack web app on AWS.
--------------------------------------------------------------
Time Stamps
0:00 Intro
0:39 EC2 Instance setup
2:21 Prerequisite Project
2:47 Installing Required Modules
4:19 Cloning and Backend test
6:44 PM2 Setup
8:00 Installing Frontend
8:33 Nginx Setup
12:50 Adding Inbound Rules and Testing
14:07 Connecting Frontend & Backend
17:33 Resolving CORS error
19:06 Final Test and Outro
--------------------------------------------------------------
NGINX server file
server {
listen 80;
server_name _;

root /var/www/html;
index index.html;

location / {
try_files $uri /index.html;
}

location /api/ {
proxy_pass http://[your-ec2-ip]:[backend-port];
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
---------------------------------------------------------

✅ Subscribe for more web development & deployment tutorials!
💬 Drop your questions in the comments — I’ll be happy to help.

#AWS #NodeJS #React #Deployment #FullStack #ec2


On this page of the site you can watch the video online Deploy Your Full-Stack App on a single AWS EC2 Instance | ReactJs, NodeJs, Nginx and PM2 setup with a duration of hours minute second in good quality, which was uploaded by the user Ashutosh Verma 05 September 2025, share the link with friends and acquaintances, this video has already been watched 2,404 times on youtube and it was liked by 54 viewers. Enjoy your viewing!