
Install Fumadocs Manually
Build a fresh Fumadocs setup step by step inside a new Next.js project.
Read the Quick Start guide first for basic concept.
Start from a Blank App
Begin with a fresh Next.js project created through create-next-app, then install the packages Fumadocs needs.
fumadocs-ui fumadocs-coreChoose a Content Source
Fumadocs works with multiple content sources, so pick the one that matches your workflow.
Officially supported options include:
Before moving on, make sure the source library itself is configured correctly. In this guide, the source adapter is imported from @/lib/source.ts.
Set Up the Root Layout
Wrap the entire app with Root Provider, then give body the minimum layout styling it needs.
import { RootProvider } from 'fumadocs-ui/provider';
import type { ReactNode } from 'react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body
// you can use Tailwind CSS too
style={{
display: 'flex',
flexDirection: 'column',
minHeight: '100vh',
}}
>
<RootProvider>{children}</RootProvider>
</body>
</html>
);
}Add Styles
Install Tailwind CSS v4 in your Next.js app, then place the following imports in global.css.
@import 'tailwindcss';
@import 'fumadocs-ui/css/neutral.css';
@import 'fumadocs-ui/css/preset.css';
/* path of `fumadocs-ui` relative to the CSS file */
@source '../node_modules/fumadocs-ui/dist/**/*.js';It doesn't come with a default font, you may choose one from next/font.
Configure Shared Layout Options
Create app/layout.config.tsx to hold the options reused by your layouts.
{
"file": "../../examples/next-mdx/app/layout.config.tsx",
"codeblock": {
"meta": "title=\"app/layout.config.tsx\""
}
}Next, create /app/docs and give the docs section its own layout.
{
"file": "../../examples/next-mdx/app/docs/layout.tsx",
"codeblock": {
"meta": "title=\"app/docs/layout.tsx\""
}
}pageTree refers to Page Tree, it should be provided by your content source.
Add the Docs Page Route
Create the catch-all route at /app/docs/[[...slug]] to serve documentation pages.
Inside that page, render content with the Page component.
The exact implementation depends on the content source you chose, and you should also configure generateStaticParams for static rendering plus generateMetadata for metadata.
{
"file": "../../examples/next-mdx/app/docs/[[...slug]]/page.tsx",
"codeblock": {
"meta": "title=\"app/docs/[[...slug]]/page.tsx\" tab=\"Fumadocs MDX\""
}
}{
"file": "../../examples/content-collections/app/docs/[[...slug]]/page.tsx",
"codeblock": {
"meta": "title=\"app/docs/[[...slug]]/page.tsx\" tab=\"Content Collections\""
}
}Enable Search
You can use the built-in document search powered by Orama.
{
"file": "../../examples/next-mdx/app/api/search/route.ts",
"codeblock": {
"meta": "title=\"app/api/search/route.ts\" tab=\"Fumadocs MDX\""
}
}{
"file": "../../examples/content-collections/app/api/search/route.ts",
"codeblock": {
"meta": "title=\"app/api/search/route.ts\" tab=\"Content Collections\""
}
}Read more in Document Search.
Finish Up
At this point you can run the dev server and begin writing MDX files.
---
title: Hello World
---
## Introduction
I love Anime.Further Customization
For other pages on your site, you can use Home Layout, which already includes a navbar and theme toggle.
Deployment
The setup should deploy out of the box to Vercel and Netlify.
Docker Deployment
If you plan to ship a Docker image with Fumadocs MDX configured, remember to copy source.config.ts into the Docker WORKDIR.
The snippet below comes from the official Next.js Dockerfile Example:
WORKDIR /app
# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* source.config.ts ./That way, Fumadocs MDX can still read the configuration file during the build.
More Posts

22 Major Arcana Tarot Meanings on Orelune
A clear guide to the Major Arcana tarot meanings, from The Fool to The World. Explore how each card reflects life lessons, love, change, and destiny through Orelune.


Why Is The Fool Tarot Card Called "The Fool"?
Explore why The Fool is numbered 0, where the card originated, and how it came to represent beginnings, risk, freedom, and limitless potential in tarot.


Premium Content Access Demo
A sample post for testing premium blog access with Stripe sandbox checkout.
Newsletter
Join the community
Subscribe to our newsletter for the latest news and updates