Free Astro tutorials for complete beginners.

Beginner's Guide to Astro

How to Add an Integration to Astro

Integrations add new abilities to your Astro site, a bit like plugins. Here's how to install 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: Approve the changes
  3. Step 3: Restart your dev server
  4. Three integrations worth knowing
  5. Frequently asked questions

Integrations add features to your Astro project, such as MDX support, a sitemap, or the ability to use React components.

Step 1: Run astro add

In your project folder, run this command:

npx astro add mdx

You can replace mdx with the integration you want. For example, use sitemap or react.

Step 2: Approve the changes

Astro shows you exactly what it’s about to change and asks you to confirm. Press Enter or type y to accept.

It installs the package and adds it to astro.config.mjs, which 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

Press Ctrl and C to stop your dev server, then start it again with npm run dev.

Three integrations worth knowing

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

Only add what you need. Every integration is one more thing to keep updated.

For step-by-step guides to the most useful ones, see how to add Tailwind CSS and how to add a sitemap.

Frequently asked questions

Is an integration the same as a WordPress plugin?

They're similar, but integrations usually work at build time and rarely add a settings page. You configure them in astro.config.mjs.

Where can I find integrations?

Browse the official directory at astro.build/integrations.

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. How to Build an Astro Website With Claude (Step by Step)

    Use Claude to build a real Astro site, in the chat at claude.ai or with Claude Code in your terminal. This very site was built that way.

    Build with AI, 9 minute read, November 6, 2026

  2. What Is EmDash? Cloudflare's Astro CMS Explained

    EmDash is an open-source CMS from Cloudflare, built on Astro. Here's what it does, how it differs from WordPress, and who it's for.

    EmDash, 7 minute read, November 6, 2026

  3. How to Build an Astro Website With ChatGPT

    Use ChatGPT to build an Astro site, either by chatting and pasting code, or with Codex, OpenAI's coding agent that works inside your project.

    Build with AI, 8 minute read, November 6, 2026

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