How to Build an Astro Static Site: A Beginner’s Guide (Using Claude Code)
An Astro static site is a website built with Astro, a free, open-source framework that turns your pages into plain HTML files before anyone visits. You can build one without coding by asking Claude Code to create the site, save it to GitHub and put it live on Cloudflare’s free plan. I built my first Astro site this way, and it had a working version live after one afternoon.
People I speak with often ask me how to build a website like this, because they would like one too but do not know where to start. Most of the guides they find are written for developers, so it is completely normal to feel a bit lost at first. I mainly work with WordPress and Astro was new to me, so I had many of the same questions when I started.
In this guide, I will walk you through how I built my first Astro static site with Claude Code, GitHub and Cloudflare. I will also share what confused me, what I would do differently, and when I would still choose WordPress instead. I am still learning Astro myself, so this is one beginner’s experience rather than expert advice.
What Is an Astro Static Site?
A static site is a website made of ready-made files, such as HTML, CSS and images. When someone visits a page, the server simply sends the finished file, instead of building the page from a database each time like WordPress does.
Astro is a static site generator, which means it turns your pages and blog posts into those finished files when you build the site. You may see it called Astro JS or the Astro framework, and it is free and open source under the MIT licence.
I am often asked how a static site can be safe and fast. With no database, no plugins and no admin login on the server, there is far less for hackers to attack and far less to slow your pages down. Your host just sends small, ready-made files to each visitor.
Astro vs WordPress: When I Would Pick Each
I work with WordPress every day, and it is still the right choice for many businesses. It is a great fit when a site needs regular updates, lots of features, or a team that wants full control through a familiar dashboard.
I would pick Astro when a website does not need many updates, and the client does not need the full setup that WordPress offers. That might be a client who is unlikely to keep their site updated, or who does not know how WordPress works. If they do not want much control either, a static Astro site could be the better way forward.
The one thing I would always check first is that the client knows how to edit their site. With Astro, your content lives in files rather than in a dashboard, so whoever runs the site needs a clear and simple way to make changes.
What You Need Before You Start
You only need a few accounts and tools to get going:
Claude Code and my domain were the only two things I paid for. I was on the Max plan because I use Claude for a lot of client work. For a site like this, though, Pro is enough, as long as you are smart with models and do not use Opus for everything.
You do not need to set up much by hand either. Astro needs Node.js version 22.23.4 or higher, and you can ask Claude Code to check this and run the Astro setup for you. The Claude desktop app also lets you use Claude Code without opening a terminal.
Step 1: Build Your Astro Site with Claude Code
Everything on my site was written by Claude Code, from the design and pages to the blog setup and basic SEO. I know a little about code from online courses and from working with WordPress, which helped me follow along, but I did not write the code myself.
I did not use an Astro theme. Instead, have a design or template ready before you ask Claude Code to build the site. I made my design in Google Stitch, an AI design tool from Google Labs, and Claude Code then built the site from it.
Claude Code also starts a small preview of the site on your computer. This means you can open it in your browser, look at each page, and ask for changes until you are happy with it.
Before you start, write down the true facts about you and your business, and give them to Claude Code. I built a drone guide site for beginners, and its first draft claimed things that were not true, like gear I do not own. Having a facts file made these much easier to correct.
Step 2: Save Your Site to GitHub
GitHub is where your site’s files are stored, and it keeps a history of every change you make. I kept my project in a private repository, which is free on GitHub.
This part was the most confusing for me, because commits, branches and pull requests were all new. Here is the plain version I wish I had at the start:
You do not need to remember all of this on day one. Ask Claude Code to explain each step before it does it, and to tell you which step makes your changes go live.
Step 3: Put Your Astro Static Site Live on Cloudflare
Cloudflare hosts your finished site, and it can also look after your domain. Astro’s deploy guide says Cloudflare recommends Cloudflare Workers for new projects, rather than Cloudflare Pages.
For beginners, I would suggest Workers Builds, which is Cloudflare’s own way to connect to GitHub. In the Cloudflare dashboard, you create an application and pick your GitHub repository, and from then on every change you merge into main builds and goes live by itself. The free plan includes 3,000 build minutes a month, which is plenty for a small site.
My own site uses a slightly different setup that Claude Code made with GitHub Actions, and it works well. If I started again, I would pick Workers Builds, because it is free and you set it up inside Cloudflare.
Once the site is live, you add your domain to the Worker as a custom domain in Cloudflare. If you bought your domain elsewhere, like I did with Spaceship, you first switch its nameservers to Cloudflare.
Cloudflare is not the only option. Bunny.net can also host static sites, using a storage zone for your files with its CDN in front. Its new command-line tool, still in public preview, can build and upload an Astro site for you.
How to Update Your Astro Site After It Is Live
I update my site by asking Claude Code to make the change, such as adding a new blog post or changing some text on a page. I normally start a new chat for each update, so every chat stays focused on one job.
Be specific when you ask. Tell Claude Code which page to change, exactly what the new text or post should say, and whether you would like it to go live when it is done.
Do Astro Sites Need Updates?
When I started, I believed an Astro site was completely safe and needed no maintenance, unlike WordPress. I found out that is not quite true during a design audit of my own site, when Claude Code ran a security check called npm audit. It flagged several “critical” and “high” warnings and recommended upgrading from Astro 6 to Astro 7.
The good news is that a static Astro site is far lower risk than WordPress, which runs live code, a database, plugins and a login page on every visit. On WordPress, a new security hole can be attacked on the live site very fast. Patchstack’s 2026 report found that the most targeted holes were attacked at scale a median of five hours after going public.
My site is fully static, so visitors only download plain HTML, CSS and images from Cloudflare. There is no database, no login page and no server code running when someone visits, which removes most of what attackers look for.
What the Warnings Actually Meant
Low risk is not the same as no risk, though. The tools that build your site are still software, and software has bugs. Most of the warnings I saw affected my own computer or the build on GitHub Actions, not the people visiting my site.
In theory, the XSS bugs could end up baked into the HTML files visitors download, but only if an attacker’s text or images got into your content. If you write all the content and pick all the images yourself, the risk is low. It grows if you later pull in content from WordPress, other people or downloaded images.
Updates matter more if your Astro site is not fully static and uses on-demand (server) rendering on Cloudflare Workers. In that case, Astro code runs live every time someone visits, which is much closer to how WordPress works.
npm audit labels can also sound scarier than they are. “Critical” describes how bad the bug is, not how risky it is for your particular site. It is worth asking Claude Code whether each warning actually applies to your setup.
Claude Code did the upgrade to Astro 7 as a separate task, without mixing it in with other changes. It needed a one-line fix to the deploy workflow, and after that npm audit found no problems. Staying current is cheaper, because every major version you skip makes the next upgrade bigger.
My Simple Maintenance Routine
This is the routine I now follow:
Treat it as a 15-minute chore, not an emergency. The one exception is a site that uses server rendering, where a serious Astro warning is worth fixing straight away.
What I Found Confusing and What I Would Do Differently
My first deploy failed because I had not finished setting up my Cloudflare account. Set up your GitHub and Cloudflare accounts properly before you build anything.
I also ran several Claude Code chats on the same project at the same time, and they mixed up each other’s work. Nothing was lost, but it was hard to tell which chat had changed what, so one chat per task is much easier to follow.
At first, I also tried a visual site builder called Phantom Studio, but I may not have set it up correctly. Visual editors like Phantom Studio or Sitereal, a desktop builder that writes real Astro files into your project, can still work well. Just make sure you set them up properly and understand how you will edit the site afterwards.
If I started again, I would do everything with Claude Code, and take the time to understand how GitHub and Cloudflare Workers work. Ask Claude Code to guide you through each step, and to explain anything that is new to you.
FAQs
Would You Like a Second Opinion on Astro or WordPress?
Building a static site for the first time can feel like a lot, and getting stuck now and then is completely normal. If you are trying to decide between Astro and WordPress, I am happy to share what I have learned and give you a second opinion.
You can find out more about my website development services, or simply reach out and tell me about your project.



