Free Astro tutorials for complete beginners.

Beginner's Guide to Astro

How to Make a Website With Astro (Step by Step)

Build and publish your first website with Astro in about an hour. No coding experience needed, just a computer and a free account.

Tested on Astro 7.4

Cover image for How to Make a Website With Astro (Step by Step)
In this guide
  1. What you need before you start
  2. Step 1: Install Node.js and VS Code
  3. Step 2: Create your project
  4. Step 3: Edit your home page
  5. Step 4: Add another page
  6. Step 5: Publish your site
  7. What to do next
  8. Frequently asked questions

If you want a fast website that you fully own, Astro is a great way to build it. This guide covers the whole journey, from an empty computer to a live site.

Want more detail on each stage? Our free seven-lesson course covers the same ground, slowly.

What you need before you start

You need a computer running Windows, macOS or Linux, and about an hour. Everything in this guide is free.

What Why Cost
Node.js Runs Astro on your computer Free
VS Code Lets you edit your site’s files Free
A hosting account Puts your site on the internet Free plan

Step 1: Install Node.js and VS Code

Download the LTS version from nodejs.org and VS Code, and install both with the default options. Astro needs Node.js 22.23.4 or newer.

Open VS Code, then choose Terminal and New Terminal from the menu. Check that Node.js is installed:

node -v

Step 2: Create your project

Run the setup wizard:

npm create astro@latest my-site -- --template basics

Say yes when it offers to install dependencies. Then open the new folder and start your site:

cd my-site
npm run dev

Open the address shown in your terminal, usually http://localhost:4321, and you’ll see your new site.

Step 3: Edit your home page

In VS Code, open your project folder and find src/pages/index.astro. Every file in src/pages is a page on your site.

Replace the contents with this:

---
import Layout from '../layouts/Layout.astro';
---
<Layout>
  <h1>Welcome to my website</h1>
  <p>I built this with Astro.</p>
</Layout>

Save the file, and your browser updates by itself.

Step 4: Add another page

Create a file called src/pages/about.astro:

---
import Layout from '../layouts/Layout.astro';
---
<Layout>
  <h1>About me</h1>
  <p>Write something about yourself here.</p>
</Layout>

Visit /about in your browser. Creating the file created the page.

Step 5: Publish your site

Stop the dev server by pressing Ctrl and C, then build your site:

npm run build

Your finished website is now in the dist folder. To put it online, drag that folder onto Netlify Drop. You’ll get a live address within seconds.

For a longer-term setup that republishes whenever you make a change, see our guide to the best hosting for Astro.

What to do next

Frequently asked questions

Do I need to know how to code to use Astro?

No. You'll copy some code at first, and you'll understand it as you go. Knowing a little HTML helps, and you can learn it along the way.

How much does it cost to make a website with Astro?

Astro is free and open source, and several hosts have free plans. The only cost you're likely to want is a custom domain name.

Can I use my own domain name?

Yes. Buy a domain from any registrar, then connect it in your host's dashboard. Each host has its own guide.

Stuck on a step?

Check the common errors guide, look up a word in the glossary, or ask in the official Astro Discord, where the support channels are friendly to beginners.

Keep reading

  1. Astro SEO: A Beginner's Guide to Getting Found on Google

    Everything an Astro site needs to rank: titles, descriptions, canonical links, a sitemap, social previews and structured data, with code you can copy.

    Beginner's guides, 9 minute read, November 6, 2026

  2. Astro vs Next.js: Which Is Better for Beginners?

    Astro and Next.js are both popular, but they're built for different jobs. Here's which one to learn first, and why.

    Beginner's guides, 6 minute read, November 6, 2026

  3. What Is Astro? A Plain-English Explanation

    Astro is a free tool for building fast websites. Here's what it does, who it's for, and how it differs from WordPress and React.

    Beginner's guides, 6 minute read, November 5, 2026

Try "blog", "deploy" or "EmDash".