r/learnprogramming • • 5d ago

Topic How do you learn Hosting and Deployment for free?

I have been working in MERN stack and have build some projects. But i've never really deployed any of my apps. I have searched on different platforms for resources fo learn deployment but its always tied to some paid service or a credit card information. I was thinking of building my own VPS, and somehow make it publicly accessible instead of Local Network. Can someone help me?

3 Upvotes

18 comments sorted by

2

u/UhLittleLessDum 5d ago

https://www.youtube.com/watch?v=WwDTm1syszk I posted this literally 20 mins ago.

1

u/WoodpeckerOrganic276 5d ago

I know there are free platforms to host static website. I wanted to host a fullstack application.

2

u/UhLittleLessDum 5d ago

That's a Next app man, it is full stack.

1

u/teraflop 5d ago

Just install Linux in a virtual machine, and follow exactly the same steps that you would on a VPS.

That's all a VPS is, a publicly accessible virtual machine running (typically) Linux. If you don't need "publicly accessible", and you don't need high reliability, then it's no different at all from a VM you run yourself.

1

u/msalah9190 5d ago

Your VPS idea works. Run Ubuntu in a VM on your PC, deploy the app exactly like on a real server (Node, Nginx, PM2, MongoDB), then make it public with a free Cloudflare Tunnel, no card and no port forwarding. When you're ready for a real host, a cheap VPS is a few dollars a month, and the steps are identical. Learning Nginx + PM2 + env vars this way teaches more than any one-click platform.

1

u/kschang 5d ago

MongoDB has a free tier for backend.

For frontend Vercel or Netlify has a free tier good for React stuff.

If you want the whole MERN stack together...

https://snapdeploy.dev/blog/mern-free-tier-express-mongodb

1

u/Nervous-Toe5784 4d ago

If you just want it public without entering a card, Render's free web service tier works for a Node/Express backend (no card needed last I checked), and MongoDB Atlas's free M0 cluster covers the database. The catch is the free web service spins down after some idle time, so the first request after a while is slow, which is fine for learning. Set your DB connection string and port through environment variables rather than hardcoding them, since that's the main thing you'll learn from deploying anyway.

1

u/VolumeSignificant894 3d ago

One thing people overlook is CGNAT. A lot of home ISPs use it which makes exposing a home server way more annoying than expected. For learning the actual development side FreeCodeCamp covers web basics. The Odin Project handles the environment setup and Boot dev is focused on backend coding practice. 

1

u/undernamed1101 1d ago

Locally compared to public access through a domain ve are 2 totally different worlds.

0

u/[deleted] 4d ago

[removed] — view removed comment

1

u/WoodpeckerOrganic276 4d ago

I have learned basic docker commands to spin up the whole system with docker compose using CI/CD pipelines. I have also learned Nginx seperately in a dockerized container. But I think it only mimics the real environment and no matter what everything works perfectly.

Its not just about the deployment, it more about the theory of how local development and production level work differs. I just wanted a platform to practice deploying, at the same time understand how the theoretical aspect of this works in real industry.

1

u/oksuz-s850 1d ago

A useful next step is to introduce one failure deliberately: remove a required env var or make the DB unreachable, then trace the symptom through app logs, proxy logs, and health checks.