The MERN stack (MongoDB, Express, React and Node.js) lets you build a complete web application in one language, JavaScript, from the database query to the button on the screen. This page is a roadmap and resource index: what each part does, what to learn first, how to set up a modern project in 2026, which tutorials on this knowledge base to follow, and where to run the finished app.
Learn JavaScript properly first, then React (with Vite, not Create React App), then Node.js with Express 5, then MongoDB with Mongoose. Build one small full-stack app end to end before anything bigger. For hosting, the Domain India App Platform runs Node.js apps and detects them automatically but includes PostgreSQL rather than MongoDB, so pair it with a hosted MongoDB such as Atlas; on a VPS you can run everything yourself.
1. What each part of MERN does
| Layer | Technology | Its job |
|---|---|---|
| Database | MongoDB (usually with Mongoose) | Stores data as JSON-like documents |
| API | Express on Node.js | Receives HTTP requests, applies rules, reads and writes the database |
| Runtime | Node.js | Runs JavaScript on the server |
| Interface | React | Builds the pages and components the user sees in the browser |
A typical request flows like this: the React app calls an API route such as /api/orders, Express checks the user and the input, Mongoose queries MongoDB, and the result goes back to React as JSON.
2. Is MERN the right choice?
- Teams that want one language across front end and back end
- Apps with flexible or changing data shapes
- Interactive dashboards, internal tools and single-page apps
- Real-time features, using WebSockets alongside the API
- Your data is strongly relational (accounts, invoices, stock): PostgreSQL or MySQL is usually a better fit
- Search engines must see every page's content: a framework with server rendering, such as Next.js, helps
- The site is mostly content: a CMS or a static site is simpler
Swapping MongoDB for PostgreSQL gives you a "PERN" stack with the same Express and React skills. Choosing between PostgreSQL, MySQL, SQLite and MongoDB compares them.
3. What to learn, in order
- HTML, CSS and JavaScript.Solid JavaScript comes first: functions, arrays and objects, modules, and especially promises and async/await. Follow the JavaScript roadmap from fundamentals to expert.
- The command line and Git.You will use a terminal and version control every day.
- React.Components, props, state, hooks, forms and fetching data from an API. Create projects with Vite.
- Node.js and Express.Routes, middleware, error handling, environment variables and a clean folder structure.
- MongoDB and Mongoose.Documents and collections, schemas, validation, indexes and relationships between documents.
- Authentication.Password hashing, sessions or tokens, and role checks on the server.
- Deployment.Environment variables, builds, logs and a production database.
Build something small at each step. A to-do list, a notes app or an event list covers most of what you need before you attempt a larger project.
4. Setting up a modern MERN project
Install the current Node.js LTS release (Node.js 24 in September 2026) from nodejs.org or with a version manager such as nvm. Then create the API and the React app in one project:
mkdir my-app && cd my-app
npm init -y
npm install express mongoose
npm create vite@latest client -- --template reactA minimal Express server that reads its settings from the environment:
// server.js (add "type": "module" to package.json)
import express from 'express';
import mongoose from 'mongoose';
const app = express();
app.use(express.json());
app.get('/api/health', (req, res) => res.json({ ok: true }));
await mongoose.connect(process.env.MONGODB_URI);
const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0', () => console.log(`API on port ${port}`));For the database, a free MongoDB Atlas cluster is the quickest start; MongoDB Community Edition on your own computer also works. Keep the connection string in an environment variable, never in your code or in Git.
Create React App is deprecated, so don't follow tutorials that start with npx create-react-app. Express 5 is the current major version, and its route syntax differs slightly from Express 4, so check that a tutorial's examples match.
5. Tutorials on this knowledge base
Work through these in order:
Going further: modern Next.js App Router patterns for server rendering, and modern Node.js with Hono and Bun for lighter APIs.
6. Production checklist
Before real users arrive:
- Configuration: every secret and connection string in environment variables;
NODE_ENV=production. - Security: validate all input on the server, hash passwords with bcrypt or argon2, set secure HTTP headers (for example with Helmet), restrict CORS to your own domain, and rate-limit login routes.
- Database: add indexes for the fields you query, restrict database access to your app, and set up backups (check which backups your Atlas tier includes; on your own server, schedule
mongodump). - Front end: serve the built React files, not the development server.
- Operations: log errors somewhere you will read them, and on a VPS keep the app running with a process manager such as PM2 or systemd.
7. Where to run a MERN app on Domain India
| Option | Node.js app | MongoDB | Best for |
|---|---|---|---|
| App Platform | Detected automatically from package.json; deploy with Deploy Now or a deploy token | Not included (PostgreSQL is); use a hosted MongoDB such as Atlas | Most MERN apps |
| VPS | You install and run it | You install and run it on the same server | Full control, background services, your own database |
| cPanel or DirectAdmin shared hosting | The panel's Node.js tool, for small apps | Not provided; ask support before relying on an external database | Small APIs next to an existing website |
On the App Platform, your app must listen on the PORT environment variable and bind to 0.0.0.0, as in the example above. Atlas accepts connections only from addresses on its access list; ask support which outbound address to allow. A VPS is self-managed and comes without a control panel. Jailed SSH access is available on every shared hosting plan (cPanel, DirectAdmin, Webuzo); it is off by default, so ask support to enable it for your account.
- 512 MB RAM per app
- 1.5 GB RAM total
- 2 vCPU
- 10 GB NVMe SSD
- 1 vCPU
- 2 GB DDR4 RAM
- 64 GB NVMe SSD Storage
- 2 TB Monthly Bandwidth
Prices on the cards are Domain India list prices and exclude 18% GST.
Frequently asked questions
What is the MERN stack?
MERN stands for MongoDB, Express, React and Node.js. MongoDB stores the data, Express on Node.js provides the API, and React builds the interface in the browser, so the whole application is written in JavaScript.
What should I learn before the MERN stack?
Learn HTML, CSS and JavaScript well first, especially functions, arrays and objects, modules and async/await. Basic command-line skills and Git are also needed before you start with React, Express and MongoDB.
Should I use Create React App for a new MERN project?
No. Create React App is deprecated. Create the React part of a new project with Vite instead, or use a framework such as Next.js if you need server rendering.
Can I host a MERN app on the Domain India App Platform?
Yes. The App Platform detects Node.js apps automatically and serves them over HTTPS. It includes a PostgreSQL database rather than MongoDB, so use a hosted MongoDB such as MongoDB Atlas and put its connection string in an environment variable.
Can I run MongoDB on Domain India shared hosting?
MongoDB is not provided on shared hosting. Use a VPS, where you can install MongoDB yourself, or a hosted MongoDB service with the App Platform.
Is MongoDB always the right database for a MERN app?
No. MongoDB suits flexible, document-shaped data. For strongly relational data such as accounts, invoices and stock, PostgreSQL or MySQL is usually a better fit, and Express and React work the same way with them.
Ready to build? Start with the event management MERN tutorial, then deploy it on the App Platform or a VPS.
Node.js apps are detected and built automatically, with free SSL and zero-downtime deploys.
See the App Platform