WanderLust is a full-stack Node.js web application that can be deployed on an AWS EC2 instance without using Docker. This guide walks you through every step to host your app using PM2 and Node.js on Ubuntu.
- Go to AWS EC2 Console
- Click Launch Instance
- Choose:
- Amazon Machine Image (AMI): Ubuntu 22.04
- Instance Type: t2.micro (Free Tier eligible)
- Key Pair: Create or use an existing
.pemfile
- Security Group Configuration:
- β Allow SSH (Port 22)
- β Allow HTTP (Port 80)
- β
Add Custom TCP Rule: Port
3000, Source:0.0.0.0/0
ssh -i /path/to/your-key.pem ubuntu@<your-ec2-public-ip>sudo apt update
sudo apt install nodejs npm git -y
node -v
npm -vgit clone https://github.com/Satishchoudhary94/WanderLust.git
cd WanderLustcd WanderLust
npm installCreate a .env file in the root of the project and add:
CLOUD_NAME=
CLOUD_API_KEY=
CLOUD_API_SECRET=
MAP_API_KEY=
ATLAS_URL=mongodb+srv://schoudhary3741:7y7EW1oIqPGKRpKk@cluster0.d6ptcxb.mongodb.net/?retryWrites=true&w=majority&appName=Cluster0
or
MONGO_URL=your_mongodb_connection_stringnode app.jshttp://<your-ec2-public-ip>:3000π Project Structure Overview
WanderLust/
βββ app.js
βββ package.json
βββ .env
βββ /routes
βββ /views
βββ /models
βββ /controllers
βββ /publicπ¨βπ» Author Satish Choudhary GitHub: @Satishchoudhary94
Thanks