Managed vs Unmanaged VPS: A Beginner’s Guide (Bangladesh)
Managed vs unmanaged VPS explained: who does what, cost difference, skills you need, free control panels, a security checklist and which one to pick.
Deploy a Node.js or Next.js app on an Ubuntu VPS: secure the server, install Node with nvm, run with PM2, put Nginx in front, add free SSL and deploy updates.
FlexoHost Team
Technical guides & hosting tips

This guide takes a fresh Ubuntu VPS to a running Node.js or Next.js app with HTTPS. It works on any Ubuntu 22.04/24.04 server; a BDIX VPS in Dhaka is a good choice when your users are in Bangladesh (BDIX VPS).
You need: a VPS with root access, a domain pointing to the VPS IP (A record), and your app in a Git repository.
ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
adduser deploy
usermod -aG sudo deploy
mkdir -p /home/deploy/.ssh && cp ~/.ssh/authorized_keys /home/deploy/.ssh/
chown -R deploy:deploy /home/deploy/.ssh
Then in /etc/ssh/sshd_config set PermitRootLogin no and PasswordAuthentication no (only after you confirmed key login works), and run systemctl restart ssh.
ufw allow OpenSSH
ufw allow 'Nginx Full'
ufw enable
(If Nginx is not installed yet, allow ports 80 and 443 after step 6.)
Log in as deploy, then:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.bashrc
nvm install --lts
node -v
git clone https://github.com/you/your-app.git ~/app
cd ~/app
npm ci
npm run build # Next.js; skip for a plain Express app
Low on RAM during next build? Add a swap file:
sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile
sudo mkswap /swapfile && sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
Put secrets in a .env file (never commit it).
npm install -g pm2
pm2 start npm --name app -- start # Next.js listens on port 3000 by default
pm2 save
pm2 startup # run the printed command once
Check with pm2 status and pm2 logs app.
sudo apt install -y nginx
sudo nano /etc/nginx/sites-available/app
server {
listen 80;
server_name example.com www.example.com;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
sudo ln -s /etc/nginx/sites-available/app /etc/nginx/sites-enabled/
sudo nginx -t && sudo systemctl reload nginx
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
Certbot sets up HTTPS and automatic renewal. Test renewal with sudo certbot renew --dry-run.
cd ~/app
git pull
npm ci
npm run build
pm2 reload app
Save this as deploy.sh to run with one command, or trigger it from GitHub Actions over SSH.
sudo apt install unattended-upgrades for automatic security updatespm2 install pm2-logrotate so logs do not fill the disk.env off the server| Problem | Check |
|---|---|
| 502 Bad Gateway | Is the app running? pm2 status; does the port match Nginx? |
| Build killed | Out of memory: add swap or a bigger plan |
| Site not loading on domain | DNS A record points to the VPS IP? Firewall allows 80/443? |
| Changes not visible | Did you rebuild and pm2 reload? |
| App | Suggested |
|---|---|
| Small API or Express app | 1 vCPU, 1 GB RAM |
| Next.js site (with builds on server) | 2 vCPU, 2 GB RAM |
| App + database (PostgreSQL/MySQL) | 4 vCPU, 4 GB RAM |
Prefer not to manage a server? Small apps can run on cPanel: Node.js app in cPanel. Comparing options: best VPS in Bangladesh.
A small Next.js or Express app runs on 1 vCPU and 1 GB RAM, but building Next.js needs more memory; 2 GB is a comfortable start. Larger apps with a database need 4 GB.
PM2 keeps your Node.js process running, restarts it if it crashes, starts it on reboot and makes logs easy to read.
Nginx handles HTTPS, compression and static files efficiently, and forwards requests to your app on a local port.
Use Certbot with the Nginx plugin to get a free Let's Encrypt certificate that renews automatically.
Yes, small apps can run with cPanel's Setup Node.js App, or you can upload a static export. A VPS gives more control and resources.
If your users are in Bangladesh, a Dhaka BDIX VPS gives lower API and page latency than a server abroad.
Need fast hosting for your website?
NVMe SSD, LiteSpeed, free SSL and 24/7 support, with servers in Bangladesh (BDIX) and abroad.
Managed vs unmanaged VPS explained: who does what, cost difference, skills you need, free control panels, a security checklist and which one to pick.
Choosing a VPS for Bangladesh: BDIX vs Singapore vs USA, entry prices from local providers, specs that matter and a latency test you can run.
Shared hosting or VPS? Differences in resources, control, security, skills and cost in Bangladesh, signs you have outgrown shared hosting, and how to upgrade.
Please feel free to consult with one of our experts, who will thoroughly evaluate your specific requirements and provide a tailored proposal that perfectly aligns with your company's unique needs and realities.