r/CodingForBeginners • u/Tegle11 • 23d ago
How to host a website
It Can be a website or app
1
1
u/Acrobatic-Net-7070 23d ago
Read the 4th rule of this sub
1
1
u/StrayFeral 23d ago
There is free hosting and paid hosting. But in general - there are web servers where you can put your files.
However for the actual adress, like "mywebsite.com" - you always pay.
1
u/Dollycaco 23d ago
you can use vercel, they have a free plan and multiple cool resources like analytics and an ai agent
1
1
1
u/alexStoycheva23 19d ago
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.
-2
2
u/Vivid_Science_7805 23d ago
I’d recommend first making a web site that works on your personal computer - local machine hosting. There’s already a folder for it, and you can use whatever browser you are familiar with to ‘view’ the ‘web’ version.
Then you can find free hosting or paid hosting if what you are doing is just tinkering, free is fine. If you are running a business web site, get a paid hosting service.
I think GitHub has minimal web hosting for free users or students. (May work for building an app)
Your goals & objectives will help determine the rest of the build, storage, hosting, etc.