Student projects
Deploy a MERN project online
MERN is the most common stack in college projects: React on the front, Express on the back, MongoDB for data. DormHost reads the repository, installs and builds it, and runs the Express API and the React frontend as one application on a real machine.
What you get.
Deploy a MERN stack project online with MongoDB and Node.js, from ₹99 a month.
How it fits
- Node.js is detected and built automatically, with your package.json scripts
- MongoDB runs on the same machine, so your API talks to it over a loopback call
- The React frontend is served by the same process, so there is no separate static host
- An HTTPS address at yourapp-yourlogin.dormhost.app, or a custom domain through your own Cloudflare
Deploy it, step by step
The dashboard flow is the same for every project:
- Sign in with GitHub. Go to the dashboard and sign in. Your first sign-in puts 30 days of Nap credit in your balance, with no card and nothing to cancel.
- Create an application. Press New app and give it a name: three characters or more, letters, numbers and hyphens. The address is shown under the field as you type, and it is yourapp-yourlogin.dormhost.app.
- Pick the plan. Nap sleeps when nobody is using it. Awake never sleeps, which is what a bot, a worker or a scheduled job needs. Either way, you choose Mumbai, London or Ashburn.
- Point it at your repository. Paste the GitHub URL and the branch. Press Connect GitHub to pick from a list instead, which is also how a private repository is deployed. Then press Create and deploy.
- Watch the build log. The application opens on Overview, and Live logs streams the build. Listen on the port in the PORT variable we set, or EXPOSE one port in your Dockerfile, and the address answers as soon as the build finishes.
What is different about MERN
- Make Express listen on the port we set: app.listen(process.env.PORT || 3000). That is the one line most MERN projects have to change.
- Build React into the folder Express serves, from the build script in the root package.json, so one deploy ships the API and the frontend together.
- Add MongoDB in the Database section. It arrives in the app as MONGODB_URI, so read that rather than a hard-coded localhost string.
- Put your JWT secret and any API keys in the Environment section. They are set at start and never sit in the repository.
Hosting is ₹99 a month on Nap, all in: the build, the running app, the database and the storage. Nothing is metered separately, so the bill cannot surprise you. Start with 30 days of free credit, no card required. The docs cover databases, domains and what to do when a build fails.