Prerequisites
Before you begin, make sure you have:- Node.js version 18.17.1 or higher installed
- A package manager: npm, yarn, or pnpm
- A text editor (we recommend VS Code)
Create your project
Create a new Astro project
Use the Astro CLI to create a new project with the minimal template:You’ll be prompted to:
- Enter a project name
- Choose whether to initialize git
- Choose whether to install dependencies
If you choose not to install dependencies during setup, you’ll need to run
npm install manually in the next step.Navigate to your project
Change into your project directory:If you didn’t install dependencies during creation, install them now:
Start the development server
Launch the development server:Your site is now running at
http://localhost:4321!Open in your browser
Visit http://localhost:4321 to see your landing page. You should see a simple page with “Astro” as the heading.
Customize your landing page
Now let’s customize the default landing page to make it your own.Edit the main page
Opensrc/pages/index.astro in your editor. This is the main landing page. Here’s what the default template looks like:
Add some content
Let’s transform this into a simple landing page. Replace the content ofsrc/pages/index.astro with:
Notice how we use JavaScript variables in the frontmatter (between
--- markers) and then reference them in the HTML. This is one of Astro’s most powerful features.Build for production
When you’re ready to deploy your landing page:Next steps
You now have a working Astro landing page! Here are some things you can do next:Learn the basics
Understand the project structure and configuration options
Project structure
Explore the project file structure in detail
Configuration
Learn about Astro configuration options
Deploy
Deploy to Vercel, Netlify, or any static hosting service