What MEAN stack hosting is
MEAN stack hosting is a Linux server you control, where MongoDB stores the data, Express serves an API on Node.js, Angular delivers the browser app, and a process manager keeps Node alive between requests. A Node process binds to a port and stays running, so the host must allow long-running processes, which shared hosting does not.
- MongoDB — document database on 127.0.0.1:27017 with authentication enabled.
- Express — the HTTP layer inside your Node process, installed as a package rather than run as a service.
- Angular — compiled into static files in dist/ and served by Nginx.
- Node.js — the runtime for the API, supervised by PM2 so a crash restarts it.
Renting a server is the wrong purchase in two cases. A static Angular build with no API is a folder of files and runs on cheap shared hosting. A team with nobody to patch the operating system should rent a managed platform, because on this server the patching is yours.
What the server has to provide
Five things must exist before the app answers on port 443, and each one maps to a setting you can check from a terminal.
| Component | What to run | How you check it |
|---|---|---|
| Node.js runtime | Node 20 LTS from NodeSource, not the Ubuntu package | node -v prints v20.x |
| Process supervisor | PM2 with a startup hook saved | pm2 list shows online after a reboot |
| Reverse proxy | Nginx on 80 and 443, proxy_pass to 127.0.0.1:3000 | sudo nginx -t passes, page loads by domain |
| Database | MongoDB 7 bound to 127.0.0.1 with auth on | sudo ss -tlnp shows no public 27017 |
| Storage | 40 GB SSD or more for node_modules, build output and the database | df -h keeps free space above 20% |
The Node-specific workflow, including cluster mode behind PM2, sits on Node.js hosting.
How much RAM and CPU a MEAN app needs
Two gigabytes is the floor for Node and MongoDB sharing one server. Four to eight gigabytes is the practical size for production, because the Angular build, the Node heap and the MongoDB working set compete for the same memory.
| Plan | Specs | Price (₹/mo, before 18% GST) | Use it for |
|---|---|---|---|
| Cloud Entry | 2 vCPU · 8 GB RAM · 100 GB storage | 5,900 | One small production app plus its database |
| Cloud Business | 4 vCPU · 16 GB RAM · 250 GB storage | 7,900 | Image uploads, search, a growing collection |
| Cloud Pro | 8 vCPU · 32 GB RAM · 500 GB storage | 11,900 | Heavy API traffic, or MongoDB moved to its own box later |
Keep one server while the database fits in memory beside Node. Split MongoDB onto its own machine when free memory sits near zero at normal traffic, not when a single query is slow.
Install Node.js, MongoDB, PM2 and Nginx on Ubuntu 22.04
These commands assume Ubuntu 22.04 LTS, a sudo user and root SSH access. Point the domain's A record at the server IP before you start, because certificate issuance later depends on it resolving.
- Update the box:
sudo apt update && sudo apt upgrade -y. On a 2 GB plan add a 2 GB swap file before you install anything. - Install Node 20 LTS from NodeSource:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -, thensudo apt install -y nodejs. Confirm withnode -v. - Install MongoDB 7: add the MongoDB signing key and repository, then
sudo apt install -y mongodb-organdsudo systemctl enable --now mongod. Confirm withmongosh --eval "db.runCommand({ping:1})". - Deploy the code to /var/www/api with
git clone, runnpm ci, thennpm run buildfor the Angular bundle, thenpm2 start server.js --name api. - Run
pm2 startup, copy the command it prints, run that command, thenpm2 save. - Install Nginx with
sudo apt install -y nginx, putproxy_pass http://127.0.0.1:3000;in the server block, then runsudo nginx -tandsudo systemctl reload nginx.
You know it worked when curl -I http://127.0.0.1:3000 returns 200 and pm2 list shows the app online. Reboot once and check pm2 list again: if the app is still online without you starting it, the startup hook is correct.
Point the domain, add HTTPS and close the ports
Create an A record for the domain and for www at the server's IPv4 address, then wait until dig +short yourdomain.in returns that address. Request the certificate with sudo certbot --nginx -d yourdomain.in -d www.yourdomain.in, which rewrites the Nginx block to listen on 443.
Close everything else. Run sudo ufw allow OpenSSH, sudo ufw allow 'Nginx Full', then sudo ufw enable. MongoDB must stay private: sudo ss -tlnp | grep 27017 should show 127.0.0.1. If it shows 0.0.0.0, set bindIp in /etc/mongod.conf and restart mongod.
A 502 from Nginx means the proxy reached nothing: the Node process is down or listening on another port. Run pm2 logs api and curl -I http://127.0.0.1:3000, then make proxy_pass match the real port. A 404 on a deep Angular route is a different fault: add try_files $uri $uri/ /index.html; so the client router handles it.
When MEAN stack hosting is the wrong choice
Skip the server when Angular is the whole product. A build with no Express API is static files, and shared hosting serves them for a fraction of the cost. Skip it as well for an internal tool used by a handful of people, where a managed platform removes patching you would otherwise own.
Do not buy a larger server to fix one slow query. Add the index the query needs in MongoDB first. Move to a second machine only when the database working set no longer fits in memory beside the Node process.
MEAN stack hosting on WebJi® cloud servers
WebJi® sells the server, not an application platform. Cloud Entry gives 2 vCPU, 8 GB RAM and 100 GB storage at ₹5,900 per month before 18% GST, with an Ubuntu LTS image, root access and one IPv4 address. You install Node, MongoDB, PM2 and Nginx as above; support helps with the server and the network, not with your Angular code.
Migration of an existing MEAN server is free subject to terms and approval. Email support@webji.services with the current specs and OS version for a written size recommendation before payment, or use the contact page. The plans sit on cloud hosting, with raw tiers on VPS hosting.
Frequently Asked Questions
Can I run a MEAN stack on shared hosting?
No. Shared hosting serves PHP per request, does not keep a Node process alive, and does not let you run MongoDB. You need a VPS or cloud server with root access, which is what the WebJi® cloud entry plan provides.
How much RAM does a MEAN app need?
Two gigabytes is the minimum to run Node and MongoDB on one server. Four to eight gigabytes is safer in production once the Angular build and the query cache are included. Watch free memory at normal traffic before you resize.
Do I need a separate server for MongoDB?
Not for most apps. Keep MongoDB on the same server while its working set fits in RAM beside Node. Split it onto its own machine when memory stays full at normal traffic, or when a second application needs the same database.
How do I keep a Node app running after a reboot?
Run pm2 startup, execute the command it prints, then run pm2 save. Reboot the server and run pm2 list: the app must show online without you starting it by hand.
Why does Nginx return 502 for my MEAN app?
Nginx reached the proxy but nothing answered on the upstream port. Check pm2 list and run curl -I http://127.0.0.1:3000, then make the proxy_pass port match the port the Node process actually listens on.
Does WebJi® install the MEAN stack for me?
The cloud server is unmanaged for your application. WebJi® sets up the server and the network, and support answers by email 24/7 in Hindi and English with an average first reply under 60 minutes. Stack upgrades and application code are yours.

