Blog · WebJi® India

MEAN Stack Hosting

Quick answer: MEAN stack hosting is a Linux server you control, running MongoDB, Express, Angular and Node.js. Node binds to a port, so you need a process manager, a reverse proxy and a database service that stay up. A 2 vCPU, 8 GB server is enough for a small production app.
✓ In business since 2005✓ INR + GST billing✓ 24/7 Email Support — avg reply < 60 min
Indian business partners shaking hands across a desk with a dashboard open on a laptop — mean stack hosting

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.

ComponentWhat to runHow you check it
Node.js runtimeNode 20 LTS from NodeSource, not the Ubuntu packagenode -v prints v20.x
Process supervisorPM2 with a startup hook savedpm2 list shows online after a reboot
Reverse proxyNginx on 80 and 443, proxy_pass to 127.0.0.1:3000sudo nginx -t passes, page loads by domain
DatabaseMongoDB 7 bound to 127.0.0.1 with auth onsudo ss -tlnp shows no public 27017
Storage40 GB SSD or more for node_modules, build output and the databasedf -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.

PlanSpecsPrice (₹/mo, before 18% GST)Use it for
Cloud Entry2 vCPU · 8 GB RAM · 100 GB storage5,900One small production app plus its database
Cloud Business4 vCPU · 16 GB RAM · 250 GB storage7,900Image uploads, search, a growing collection
Cloud Pro8 vCPU · 32 GB RAM · 500 GB storage11,900Heavy 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.

  1. 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.
  2. Install Node 20 LTS from NodeSource: curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -, then sudo apt install -y nodejs. Confirm with node -v.
  3. Install MongoDB 7: add the MongoDB signing key and repository, then sudo apt install -y mongodb-org and sudo systemctl enable --now mongod. Confirm with mongosh --eval "db.runCommand({ping:1})".
  4. Deploy the code to /var/www/api with git clone, run npm ci, then npm run build for the Angular bundle, then pm2 start server.js --name api.
  5. Run pm2 startup, copy the command it prints, run that command, then pm2 save.
  6. Install Nginx with sudo apt install -y nginx, put proxy_pass http://127.0.0.1:3000; in the server block, then run sudo nginx -t and sudo 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.

Need help with this?

WebJi® support does it for you — free. Talk to our Jaipur team →