Free Astro tutorials for complete beginners.

Beginner's Guide to Astro

Lesson 2 of 7, about 15 minutes

Create your project

Run one command to create an Astro project, then see your site running on your own computer.

Tested on Astro 7.4

Astro has a setup wizard that creates your project for you. It’s one command.

Run the wizard

In your terminal, run:

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

This creates a folder called my-site using the smallest starter template. If you’re asked to install a package, press Enter to say yes. Say yes to installing dependencies when the wizard asks, too.

Then move into your new folder:

cd my-site

In VS Code, open the File menu, choose Open Folder, and pick my-site. Open a new terminal there as well.

Start the dev server

Run:

npm run dev

The terminal prints a local address, usually http://localhost:4321. Open it in your browser and you’ll see a page that says Astro.

That page is only on your computer. Nobody else can see it yet, so it’s safe to break things.

Look around your project

Three things matter right now:

Where What it’s for
src/pages/ Every file here becomes a page on your site
public/ Files copied as they are, like a favicon
package.json The list of tools your project uses

You’ll also see node_modules, which holds the installed tools. You never need to edit it.

What you’ve done

You have a real Astro project running on your computer. Next, you’ll change what it says.

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