Deploy Node.js App (VPS, cPanel, Render, Railway)
Deploy Node.js App (VPS, cPanel, Render, Railway)
Node.js অ্যাপ্লিকেশন সফলভাবে deploy করা একজন backend developer-এর জন্য অত্যন্ত গুরুত্বপূর্ণ স্কিল। এই গাইডে আমরা VPS, cPanel, Render এবং Railway ব্যবহার করে ধাপে ধাপে Node.js app deploy করা শিখবো।
🧰 Deploy করার আগে যা লাগবে
- Node.js app (Express.js recommended)
- package.json এবং start script
- .env ফাইল (production config)
- GitHub repository (Render / Railway এর জন্য)
🚀 Deploy Node.js App on VPS (Ubuntu)
-
VPS এ login করুন:
ssh root@your_server_ip -
Node.js install করুন:
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt install nodejs -y -
App upload করুন এবং dependencies install করুন:
git clone https://github.com/username/project.git cd project npm install -
PM2 দিয়ে app run করুন:
npm install pm2 -g pm2 start app.js --name node-app pm2 save pm2 startup
🧩 Deploy Node.js App on cPanel
cPanel hosting সাধারণত shared environment-এ থাকে এবং সহজভাবে Node.js app deploy করার সুবিধা দেয়।
- cPanel → Setup Node.js App
- Application root select করুন
- Startup file (app.js / server.js)
# package.json
"scripts": {
"start": "node app.js"
}
☁️ Deploy Node.js App on Render
- GitHub এ code push করুন
- Render → New Web Service
- Build Command:
npm install - Start Command:
node app.js
⚠️ Render এ PORT অবশ্যই process.env.PORT ব্যবহার করতে হবে।
🚄 Deploy Node.js App on Railway
- Railway account খুলুন
- New Project → Deploy from GitHub
- Environment Variables সেট করুন
app.listen(process.env.PORT || 3000, () => {
console.log("Server running...");
});
📊 VPS vs cPanel vs Render vs Railway
| Platform | Control | Ease | Best For |
|---|---|---|---|
| VPS | High | Medium | Production apps |
| cPanel | Low | Easy | Small apps |
| Render | Medium | Very Easy | Startups |
| Railway | Medium | Very Easy | Rapid deployment |
লোড হচ্ছে...
1. VPS এ Node.js অ্যাপ ডিপ্লয় করার ধাপ কী?
VPS সেটআপ, Node.js ইনস্টল, PM2 ব্যবহার করে অ্যাপ রান এবং Nginx দিয়ে reverse proxy কনফিগার করা হয়।
2. Render ও Railway কী ধরনের প্ল্যাটফর্ম?
Render ও Railway হলো cloud-based deployment platform যা সহজে Node.js অ্যাপ deploy করতে সাহায্য করে।