You can run a MERN app (MongoDB, Express, React and Node.js) on an AlmaLinux VPS from Domain India, but the recipe many older guides give no longer works in 2026: Node.js 16 is long out of support, MongoDB will not install without its own repository, and a React development server should never face the internet. This page gives you the short, current version and sends you to our full step-by-step guide.
The complete, tested walkthrough, with every command and configuration file, is Deploying and managing MERN stack applications on a RHEL-based VPS. It covers AlmaLinux and Rocky Linux 9 and 10. This page is a summary.
Use a current AlmaLinux release (9 or 10), not 8.6. Install Node.js 22 or 24, add MongoDB's official repository and install MongoDB 8.0 with authentication on and bound to 127.0.0.1. Run the Express API under PM2, build the React app and let nginx serve the build and proxy /api to Node, then add a free Let's Encrypt certificate. This applies to a VPS you manage yourself, not to shared hosting.
1. What has changed since the old version of this guide
| Old instruction | Why it fails now | Do this instead |
|---|---|---|
| AlmaLinux 8.6 | An old point release; new servers should start on a current release | AlmaLinux 9 or 10 |
| NodeSource setup_16.x | Node.js 16 reached end of life in 2023 | Node.js 22 or 24 LTS |
| dnf install mongodb-org | The package is not in AlmaLinux's own repositories | Add MongoDB's official 8.0 repository first |
| npm start for the React client behind nginx | That is a development server, not for production | Build the client and let nginx serve the files |
| proxy_pass to port 3000 | Points nginx at the development server | Proxy /api to the Express port and serve the build directly |
| No database password | MongoDB without authentication is open to anyone who reaches it | Create users and turn on authorization |
2. The steps in brief
- Secure the server.Create a sudo user, log in with an SSH key, turn off root and password logins, and allow only SSH, HTTP and HTTPS in firewalld.
- Install Node.js LTS.On AlmaLinux 9,
sudo dnf module enable -y nodejs:22and thensudo dnf install -y nodejs git. Install PM2 withsudo npm install -g pm2. - Install MongoDB 8.0.Add the
mongodb-org-8.0repository file, installmongodb-org, startmongod, create an admin user and an app user inmongosh, then setsecurity.authorization: enabledand keepbindIp: 127.0.0.1. - Deploy the API.Clone your repository, run
npm ci --omit=dev, put the connection string in a.envfile readable only by you, and start the API with PM2 on a local port such as 5000. - Build the React app.Run
npm run build(Vite outputs todist/) and copy the files to a folder such as/var/www/app. - Configure nginx.Serve the build folder, send
/api/to127.0.0.1:5000, and addtry_files $uri /index.html;so React routes work on refresh. On AlmaLinux, allow the proxy under SELinux withsudo setsebool -P httpd_can_network_connect 1. - Add HTTPS.Install Certbot from EPEL and run
sudo certbot --nginx -d example.com -d www.example.com.
Each step, with the exact files, is in the full guide. For a distribution-neutral version of the same setup, see Running MERN or MEAN on a clean VPS.
Do not open port 27017 in the firewall. Your API runs on the same server and connects to MongoDB locally. An exposed MongoDB without authentication is one of the most common causes of stolen or wiped data.
3. Running this on Domain India
A Domain India VPS is self-managed: you get full root access on KVM virtualisation and you administer the operating system and software yourself. VPS plans do not include cPanel. Shared hosting cannot run this stack, because you cannot install MongoDB there. If you would rather not manage a server, the App Platform detects and builds Node.js apps automatically and includes PostgreSQL, but not MongoDB. See Getting started with the App Platform.
- 1 vCPU
- 2 GB DDR4 RAM
- 64 GB NVMe SSD Storage
- 2 TB Monthly Bandwidth
The card shows the live Domain India price, excluding 18% GST.
Can I still follow a MERN guide written for AlmaLinux 8.6?
Not as written. It installs Node.js 16, which is out of support, and assumes MongoDB is in the system repositories, which it is not. Start on AlmaLinux 9 or 10 with Node.js 22 or 24 and MongoDB's official repository.
Which Node.js version should I use for a MERN app in 2026?
Node.js 22 or 24, the supported LTS lines. Node.js 20 and older have reached end of life.
Should nginx proxy to the React development server on port 3000?
No. Build the React app and let nginx serve the built files, and proxy only the API path, such as /api/, to your Express server.
Can I run a MERN stack on Domain India shared hosting?
Not the full stack. Shared hosting can run small Node.js apps from the control panel, but you cannot install MongoDB there. Use a VPS, or the App Platform with a database it supports.
Does Domain India manage the VPS for me?
No. Domain India VPS plans are self-managed with full root access. You install, secure and update the software yourself.
Ready to deploy? Follow the full MERN deployment guide, compare VPS plans, or look at the App Platform if you would rather not run a server. Questions about which fits your app? Open a support ticket.
Full root access on KVM virtualisation, with your choice of Linux distribution.
See VPS plans