How to build a real website for $0 with Astro and free hosting
This site runs on the setup below, and the total bill is $0. Here is how it works and where it stops being enough.
What you need
- Astro, a free framework that turns your pages into plain HTML files. Plain HTML loads fast and is easy for search engines to read. That helps, but it does not rank a site by itself. Content that answers a real question does that.
- A Git repository on a free GitHub account.
- A free static host. Cloudflare lists a free plan with 500 builds a month and 20,000 files per site. GitHub Pages is the other common choice: sites can be up to 1 GB, with a soft bandwidth limit of 100 GB a month.
Sources: Cloudflare Pages limits, GitHub Pages limits.
The steps
- Install Node.js, then run
npm create astro@latest. Pick the minimal template. - Add pages as Markdown files. Each file is one article.
- Run
npm run build. It creates adistfolder of static files. - Push the project to GitHub and connect it to the host. Every push rebuilds the site.
What it costs
Nothing for the site itself. You get a free address from the host. A custom domain such as yourname.com is the one thing worth paying for later. It is optional at the start.
What it cannot do
A static site has no database and no login. It cannot take payments by itself, and it cannot run a shop. For those, use a service that does it for you. Our guide to Systeme.io’s free plan covers one such option.
Choose this route if you are happy to edit text files. If you are not, a hosted website builder is easier and the next guides compare the costs.