Free Astro tutorials for complete beginners.

Beginner's Guide to Astro

How to Add an Integration to Astro

Integrations add new powers to your Astro site, a bit like plugins. Here is how to add one with a single command.

Tested on Astro 7.4

Cover image for How to Add an Integration to Astro
In this guide
  1. Step 1: Run astro add
  2. Step 2: Say yes to the changes
  3. Step 3: Restart your dev server
  4. Three add-ons worth knowing
  5. Frequently asked questions

An integration is an add-on for Astro. It gives your site a new power. Some add MDX support. Some make a sitemap. Some let you use React parts on a page.

Step 1: Run astro add

Open your terminal in your project folder. Then run this command:

npx astro add mdx

Swap mdx for the add-on you want. For example, use sitemap or react.

Step 2: Say yes to the changes

Astro shows you just what it will change. Then it asks you to agree. Press Enter or type y to say yes.

Astro installs the package. It also adds a line to astro.config.mjs. That file is your site’s settings file. It ends up looking like this:

import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';

export default defineConfig({
  integrations: [mdx()],
});

Step 3: Restart your dev server

Your dev server shows your site while you work on it. Press Ctrl and C to stop it. Then start it again with npm run dev.

Three add-ons worth knowing

Integration What it does
mdx Lets you use components in Markdown
sitemap Makes a sitemap for search engines
react Lets you build islands with React

Only add what you need. Each add-on is one more thing to keep up to date.

Want step-by-step help with the most useful ones? See how to add Tailwind CSS and how to add a sitemap.

Looking for ideas? See the 12 best Astro integrations for beginners, each tested on Astro 7.4.

Frequently asked questions

Is an integration the same as a WordPress plugin?

They are alike. But integrations mostly do their work at build time, and they rarely add a settings page. You set them up in astro.config.mjs.

Where can I find integrations?

Browse the official list at astro.build/integrations, or start with our list of the 12 best Astro integrations for beginners.

Stuck on a step?

Check the common errors guide, look up a word in the glossary, or ask the friendly people in the official Astro and EmDash Discords. How to ask so people can help.

Keep reading

  1. 11 Best Free Astro Themes in 2026 (Checked for Astro 7)

    The best free themes from astro.build for blogs, portfolios, business sites and docs. We checked which ones already run on Astro 7, and which are behind.

    Themes, 9 minute read, November 8, 2026

  2. How to Register a Domain Name and Connect It to Your Astro Site

    Buy a domain for about $11 a year, then point it at Cloudflare or Netlify. We did this for astronursery.com, and these are the exact steps.

    Tutorials, 8 minute read, November 8, 2026

  3. 20 Types of Websites You Can Build With Astro

    From a one-page portfolio to a documentation site with search, here are 20 kinds of websites Astro is good at, what each needs, and the few it isn't right for.

    Showcase, 8 minute read, November 8, 2026

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