r/learnprogramming • • 2d 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?

2 Upvotes

15 comments sorted by

2

u/UhLittleLessDum 2d ago

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

1

u/WoodpeckerOrganic276 2d ago

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

2

u/UhLittleLessDum 2d ago

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

1

u/ookkroam 2d ago

One thing worth knowing is that the free tiers change a lot, so it's better to learn the pieces than any one platform. Put a Dockerfile around the Express API and you can run the same container on a local VM, a cheap VPS, or most free hosts without changing anything. Have you tried containerizing it yet, or is the app still just running with npm start?

1

u/WoodpeckerOrganic276 2d 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/ookkroam 1d ago

Local and prod differ mostly in the stuff Compose on a laptop hides: real DNS, TLS, secrets, log volume, and what happens when a process dies or a disk fills. A cheap VPS is enough to practice that. Put the same compose file there, point a domain at it, put Nginx in front with a real certificate, then break things on purpose like restarting the API or filling the disk so you see what actually fails.

1

u/teraflop 2d 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 2d 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 2d 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 1d 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/Explorer651 1d ago

Render has a free web service plan that works for a Node API, so you can practice deploying without renting a VPS. It spins down after 15 minutes idle and takes about a minute to wake, which is fine for learning. Local files don't persist there, so keep your data in a database like the free Atlas cluster.

1

u/VolumeSignificant894 11h 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.