How to Build a Website With Claude Code and Host It Free
Build a website with Claude Code and host it free on GitHub Pages. Claude Code needs a paid plan ($17 to $20/month); the hosting costs $0. Steps inside.
Quick answer: Ask Claude Code to write a plain HTML, CSS and JavaScript site in a GitHub repository, then turn on GitHub Pages. Free? Hosting yes, Claude Code no.
Claude Code is not on the Free Claude plan. Anthropic's pricing page lists it for Pro, which costs $17 a month on annual billing or $20 billed monthly (as of 15 October 2026). The hosting can cost $0, as long as your site is not a business or shop.
What do you need before you start?
You need a paid way to run Claude Code, a free GitHub account and a terminal. The Claude Code quickstart says you need a Claude subscription (Pro, Max, Team or Enterprise), a Claude Console account, or access through a supported cloud provider.
Console accounts use pre-paid API credits, so they are not free either. If you have never opened a terminal, the same docs point to a terminal guide. On Windows, the docs recommend installing Git for Windows.
Checklist:
- A Claude Pro or Max plan (or a Console account with credits).
- A free GitHub account. Free accounts can use Pages only with public repositories, so assume the site is public.
- Claude Code installed. See our guide to installing Claude Code on Mac and Windows.
- Git installed on your computer.
How do you build a website with Claude Code? (Method 1: GitHub Pages, free)
Create a GitHub repository, clone it, ask Claude Code to write the site, then publish the repository with GitHub Pages. This is the simplest free route because every step is covered by official docs.
- Sign in to GitHub. In the upper-right corner, click the plus icon, then click New repository.
- Pick your account in the Owner menu and type a repository name. If you want the address
<user>.github.io, GitHub says the repository must be named<user>.github.io, with your username in lowercase. - Toggle Add README to On, then click Create repository.
- Copy the repository's HTTPS address and clone it. Verify this step: GitHub's button labels may differ.
git clone https://github.com/YOUR-USERNAME/YOUR-REPO.git
cd YOUR-REPO
- Start Claude Code from inside that folder:
claude
- On first use, Claude Code prompts you to log in. Follow the browser prompts. Type
/loginlater if you need to switch accounts. - Describe the site. Be specific about pages, content and what files to create. Example:
Build a one-page personal website for a dog walker named Sam in Leeds.
Create index.html, style.css and script.js in this folder. No frameworks,
no build step. Include a header, a services section, a prices table with
placeholder prices, a contact section with an email link, and a mobile
friendly layout. Keep every file under 300 lines.
- Claude Code asks before changing files. The docs say to select Yes to approve a change.
- Open
index.htmlin your browser and check the page. Ask for changes in plain English, such as "make the heading larger and change the colours to green and white". - When you are happy, type:
commit my changes with a descriptive message. The quickstart lists this as a supported Git prompt. - Push the commit to GitHub. You can ask Claude Code to do it, or run
git pushyourself. This assumes your default branch ismain.
Now turn on Pages:
- On GitHub, open your repository and click Settings.
- In the "Code, planning, and automation" section of the sidebar, click Pages.
- Under "Build and deployment", under "Source", select Deploy from a branch.
- Choose the
mainbranch and the/(root)folder, then click Save. - Under "GitHub Pages", click Visit site when it appears.
GitHub says Pages looks for an index.html, index.md or README.md entry file. It also says changes can take up to 10 minutes to publish.
How do you get better results from Claude Code?
Give it a check it can run. Anthropic's best practices page advises giving Claude "a check it can run: tests, a build, a screenshot to compare." For a static site, that can be "open the page, then list any broken links or missing images."
You can also press Shift+Tab to cycle permission modes. The docs describe plan mode as suited to exploring a codebase before changing it. Default mode asks before anything beyond reading files.
Method 2: How do you host the same site on Cloudflare Pages?
Cloudflare Pages can host the same folder for free. Cloudflare's docs say to go to Workers & Pages in the dashboard, then select Create application > Pages > Connect to Git.
It supports GitHub and GitLab, and both private and public repositories. After you choose the repository, select Install & Authorize and Begin setup. Then set your build options under "Set up builds and deployments". For plain HTML files there is nothing to build, so check Cloudflare's framework presets for the right setting.
You can skip Git entirely with Direct Upload. Either drag and drop a folder or zip file in the dashboard, or run this in a terminal:
npx wrangler pages deploy <BUILD_OUTPUT_DIRECTORY>
Cloudflare says the production deployment will be available at <PROJECT_NAME>.pages.dev. Wrangler accepts a single folder, not a zip.
Method 3: Can you use Netlify or Vercel instead?
Yes, both have free plans, with conditions. Netlify's Free plan is $0 a month for 300 credits with a hard limit and no auto recharge. Vercel's Hobby plan is free, but Vercel says it restricts users to non-commercial, personal use only.
On Netlify, a production deploy uses 15 credits, and web bandwidth uses 20 credits per GB (as of 15 October 2026). That means 10 production deploys use 150 of your 300 credits, leaving 150 for traffic. Netlify's Free plan has no option to buy extra credits, so check what happens to a site once credits run out.
Which method should you choose?
Pick GitHub Pages if you want the fewest accounts. Pick Cloudflare Pages if you want a private repository or file uploads without Git. All figures below are from vendor docs, as of 15 October 2026.
| Host | Cost | Difficulty | Key free-plan limits | Best for |
|---|---|---|---|---|
| GitHub Pages | $0 on GitHub Free (public repos) | Easy | Site up to 1 GB; soft 100 GB/month bandwidth; soft 10 builds/hour | Personal sites, portfolios, project pages |
| Cloudflare Pages | $0 on Free | Medium | 500 builds/month; 20,000 files; 25 MiB per file; 20 minute build timeout | Drag and drop uploads, private repos |
| Netlify Free | $0 | Medium | 300 credits/month, hard limit; 15 credits per production deploy | Deploys from Git, API or AI tools |
| Vercel Hobby | $0 | Medium | First 100 GB Fast Data Transfer; 1,000,000 CDN requests; non-commercial only | Personal projects |
What's free and what costs money?
The hosting is free. Claude Code is not. Here is the split as of 15 October 2026.
| Item | Cost |
|---|---|
| Claude Free plan | $0, but Claude Code is not included |
| Claude Pro | $17/month billed annually ($200 up front), or $20 billed monthly |
| Claude Max | From $100/month |
| GitHub Free with Pages | $0 (public repos) |
| Cloudflare Pages Free | $0 |
| Netlify Personal | $9/month for 1,000 credits |
| Netlify Pro | From $20/month |
The Claude plans are Anthropic's published prices, and the company says Claude Code shares usage limits with chat on the same plan. Prices exclude tax. A custom domain name is a separate cost that this post does not cover.
What can go wrong, and how do you fix it?
Most failures are a missing entry file, a slow publish or a wrong setting. Check these first.
- The page shows a 404. Make sure
index.htmlis at the top level of your publishing folder. GitHub looks forindex.html,index.mdorREADME.md. - Nothing changed after a push. Wait up to 10 minutes. If you publish from a branch, GitHub says someone with admin permissions and a verified email address must have pushed to the publishing source.
- The Pages setting is missing. GitHub says free accounts need a public repository for Pages. Make the repository public or upgrade.
claudeis not found after installing. Open a new terminal window and runclaude --version. If it still fails, the quickstart says the install directory is not on your PATH yet.- Windows shows
'irm' is not recognized. The docs say you are in CMD, not PowerShell, so use the CMD install command instead. - You need a form or login. GitHub Pages cannot run server-side code. For a contact form, you could send entries to a spreadsheet with a free script, as in our guide to turning a Google Sheet into an API.
Is this allowed?
Yes for personal sites, no for shops on some hosts. GitHub says Pages is not allowed as free hosting for an online business, an e-commerce site or SaaS. It also warns against sending passwords or credit card numbers through a Pages site.
Pages sites are public. GitHub warns they are publicly available on the internet even if the repository is private. Do not put API keys, customer data or private files in the repository.
Vercel Hobby is limited to non-commercial personal use. If you run a paid service, read the host's terms before you publish. If you also want to try OpenAI's tool for the same job, see our OpenAI Codex beginner's guide.
What's still unclear?
A few points depend on your situation.
- Commercial use on Cloudflare Pages and Netlify Free. GitHub and Vercel state their rules plainly. For Cloudflare and Netlify, check their terms before hosting a business.
- What happens when Netlify credits run out. Netlify says the Free plan has a hard limit and no auto recharge. Check Netlify's docs for how a live site behaves at zero credits.
- How much Claude Code usage a site build needs. Anthropic says Claude Code draws from the same usage pool as chat. A long design session on Pro may hit a limit.
- Quality. Claude Code writes what you describe, not necessarily what you meant. Review the page on a phone and a laptop, and check every link. Prices, text and contact details in AI-written pages need your own proofreading.
Last checked: 15 October 2026.
Frequently asked questions
Can I use Claude Code for free to build a website?
Not on the Free Claude plan. Anthropic's pricing page lists Claude Code as not included in Free and included in Pro, Max 5x and Max 20x, as of 15 October 2026. You can also sign in with a Claude Console account, which uses pre-paid API credits, so that route is paid too. The hosting step can be free.
Is GitHub Pages really free?
Yes, for public repositories on a GitHub Free account. GitHub's docs say Pages is available in public repositories with GitHub Free. Sites must not be used as free hosting for an online business, e-commerce site or SaaS product. The soft limits are 1 GB site size and 100 GB bandwidth per month.
Can Claude Code make a site with a login or database?
On GitHub Pages, no. GitHub says Pages does not support server-side languages such as PHP, Ruby or Python. A static site can still call outside services. A login system needs more than the steps in this post.
How long until my site goes live on GitHub Pages?
GitHub says it can take up to 10 minutes for changes to publish after you push them. If you see nothing after an hour, GitHub points you to its Jekyll build error documentation.
Which free host is best for a small business site?
Check each host's terms first. GitHub Pages bars online business and e-commerce use, and Vercel's Hobby plan is limited to non-commercial personal use, per their docs. For Cloudflare Pages and Netlify, confirm their current terms for commercial use before you launch.
Sources
- Quickstart - Claude Code Docs, Anthropic (2026-10-15)
- Claude pricing, Anthropic (2026-10-15)
- Choose a permission mode - Claude Code Docs, Anthropic (2026-10-15)
- Best practices for Claude Code - Claude Code Docs, Anthropic (2026-10-15)
- Creating a GitHub Pages site - GitHub Docs, GitHub (2026-10-15)
- Configuring a publishing source for your GitHub Pages site - GitHub Docs, GitHub (2026-10-15)
- GitHub Pages limits - GitHub Docs, GitHub (2026-10-15)
- Cloudflare Pages limits, Cloudflare (2026-10-15)
- Git integration guide - Cloudflare Pages docs, Cloudflare (2026-10-15)
- Direct Upload - Cloudflare Pages docs, Cloudflare (2026-10-15)
- Credit-based pricing plans - Netlify Docs, Netlify (2026-10-15)
- Vercel Hobby Plan, Vercel (2026-10-15)