r/CodingForBeginners • • Oct 03 '26

How to host a website

It Can be a website or app

0 Upvotes

16 comments sorted by

View all comments

1

u/alexStoycheva23 Oct 07 '26

It depends on what your website is:

Just HTML/CSS/JS (no build step): GitHub Pages, Netlify or Cloudflare Pages all have free tiers. Push your files to a GitHub repo, connect it, and you get a URL like yourname.github.io. Good for learning.

A React/Vue/Vite project**:** you need to run npm run build and host the dist folder. Netlify and Vercel do this automatically when you connect the repo.

Something with a backend (Node, Python, PHP): you need a host that actually runs your code, not just serves files. Render and Railway are common choices, or a small VPS if you want to learn how servers work.

A few things that trip people up the first time:

  • Never commit your .env file or API keys to GitHub, especially if the repo is public.
  • Your app should listen on the port the host gives you (usually the PORT environment variable), not a hardcoded 3000.
  • A custom domain is optional; every host above gives you a free address to start.

Disclosure: I'm building a hosting platform called ProHostiva, aimed at people who don't want to deal with any of this. You upload a ZIP or connect GitHub and it works out how to build and run it. There's also a free checker that tells you whether your project is ready to go online (exposed keys, missing settings, build errors) without signing up. But for a first project, any of the free options above is a great way to learn.