Hosting Your First Website: Free Options and How They Work
Learn how to host a website for free using Vercel, Netlify, and GitHub Pages. This beginner guide covers deploying static sites and simple backend apps with no upfront cost.
Building a website is one thing — putting it on the internet for people to actually visit is another. The good news: hosting a website for free has never been easier. Several excellent platforms will host your project at no cost, no credit card required.
Static Sites vs Dynamic Apps
First, understand what you’re hosting:
- Static site — HTML, CSS, JavaScript files. No server-side code. Blogs, portfolios, documentation. Vercel, Netlify, and GitHub Pages are perfect.
- Dynamic app — has a backend (Flask, FastAPI, Node.js). Needs a server to run. Railway, Render, and Fly.io offer free tiers.
GitHub Pages — Simplest Option for Static Sites
If your code is on GitHub and your site is pure HTML/CSS/JS:
- Push your code to a GitHub repository
- Go to Settings → Pages
- Select your branch (
main) and folder (/rootor/docs) - Your site is live at
username.github.io/repo-name
No configuration needed. Perfect for portfolio sites and documentation.
Vercel — Best for Modern Frontend Frameworks
Vercel is the platform built by the creators of Next.js. It handles Astro, Next.js, React, and any static site automatically:
# Install Vercel CLI
npm install -g vercel
# Deploy from your project folder
vercel
Vercel detects your framework, builds it, and gives you a live URL in under a minute. It also gives you preview deployments for every pull request — very professional workflow.
Netlify — Flexible and Beginner-Friendly
Netlify is similar to Vercel but with a more approachable UI:
- Connect your GitHub repository on netlify.com
- Set your build command (
npm run build) and publish directory (dist) - Every push to
mainauto-deploys
Both Vercel and Netlify give you a free SSL certificate, a CDN, and a custom subdomain (like mysite.vercel.app).
Adding a Custom Domain
All three platforms support custom domains for free. Buy a domain from Namecheap or Porkbun (~$10/year), then point the DNS to your hosting platform’s servers. Your site moves from mysite.vercel.app to kaiko.dev.
Conclusion
Hosting a website is free and straightforward in 2024. Start with GitHub Pages for a static portfolio, move to Vercel or Netlify when you need build pipelines, and add a custom domain when you’re ready to look professional. No excuses — your project deserves to be live.
Read next: Git Basics: The Commands You Need on Day One
External resource: Vercel Documentation
Related Articles
CSS Flexbox in Plain English: A Beginner's Guide
Learn CSS Flexbox with simple, visual explanations. This guide covers display flex, justify-content, align-items, flex-wrap, and practical layouts every developer needs to know.
Environment Variables Explained: Keeping Secrets Out of Code
Learn what environment variables are and why every developer needs them. This guide covers how to use .env files, os.environ in Python, process.env in Node.js, and best practices.
Six ES6 Features Every JavaScript Developer Should Know
Master the most important ES6 JavaScript features including arrow functions, destructuring, template literals, spread operator, modules, and default parameters with examples.