Quickstart

View as Markdown

Build beautiful developer documentation that matches your brand with Fern. Fern supports writing pages in Markdown and generating API Reference documentation from an OpenAPI Specification.

Follow this guide to get started with Fern in under 5 minutes.

Migrating from existing documentation? Fern provides a white-glove migration service as part of the Enterprise plan. Reach out here.

1

Install the CLI

Install the Fern CLI so you can manage your project from the command line:

$npm install -g fern-api
2

Initiate your docs

All the configuration for your docs lives in the fern folder. Create a fern folder by either using the starter template or starting from scratch

$git clone git@github.com:fern-api/docs-starter.git

You’ll see a basic site with a fern folder that contains an API definition, Markdown pages, and configuration files. View the live example to see what the starter template looks like when published. You can use these files to test out Fern’s features, or replace them with your own files.

fern
docs# Markdown content and assets
docs.yml# Defines navigation, theme, and hosting details
fern.config.json# Specifies org name and CLI version
generators.yml# Configures SDK generation
openapi.yaml# API definition
README.md
$fern init --docs

You’ll see a new fern folder in your project with the following configuration files (but no additional Markdown or API definition files):

fern
docs.yml# Defines navigation, theme, and hosting details
fern.config.json# Specifies org name and CLI version
3

Configure your organization

Configure two settings (these values don’t have to match):

  • Organization name in fern.config.json: Identifies your organization in the Fern system (including the Fern Dashboard)
  • Docs URL in docs.yml: Determines where your docs are published
fern.config.json
1{
2 "organization": "{{YOUR_ORGANIZATION}}",
3 "version": "3.5.0"
4}
docs.yml
1instances:
2 - url: {{YOUR_DOMAIN}}.docs.buildwithfern.com

Use only alphanumeric characters, hyphens, and underscores for both values.

4

Customize your docs

Now that you have a basic docs site, you can customize it by adding tutorials, generating an API Reference, or finetuning the branding. (Or skip ahead to preview and publish.)

Create Markdown (.mdx) files and fill them in. Read the Markdown basics documentation to learn more.

Fern supports GitHub flavored Markdown (GFM) within MDX files, no plugin required. You can also create reusable snippets to share content across multiple pages.

docs/pages/hello-world.mdx
1---
2title: "Page Title"
3description: "Subtitle (optional)"
4---
5
6Hello world!

Reference your new pages from your docs.yml file. You can reference the Markdown page within a section or as a standalone page.

docs.yml
1navigation:
2 - page: Hello World
3 path: docs/pages/hello-world.mdx
4 - section: Overview
5 contents:
6 - page: Getting Started
7 path: docs/pages/getting-started.mdx

If you cloned the starter template, you already have an openapi.yaml file with sample API definitions. If you started from scratch, add your OpenAPI spec:

$fern init --openapi /path/to/openapi.yml

Reference your API definition in the docs.yml file to generate API Reference documentation:

docs.yml
1navigation:
2 - api: "API Reference"

Configure all of your site’s branding, such as the logo, colors, and font, in the docs.yml file.

docs.yml
1colors:
2 accent-primary:
3 dark: "#f0c193"
4 light: "#af5f1b"
5
6logo:
7 dark: docs/assets/logo-dark.svg
8 light: docs/assets/logo-light.svg
9 height: 40
10 href: https://buildwithfern.com/
11
12favicon: docs/assets/favicon.svg
5

Preview your docs

Before publishing, preview your changes in your local development environment or generate shareable preview links.

Run the local development server with hot-reloading. Your docs will automatically update as you edit Markdown and OpenAPI files:

$fern docs dev
6

Publish to production

When you’re ready for your docs to be publicly accessible, publish them:

$fern generate --docs

This command builds your documentation at the URL you configured in docs.yml (e.g., https://yourdomain.docs.buildwithfern.com).

Use the Fern Dashboard to manage your GitHub repository connection, organization members, and CLI version. Track analytics to understand how developers use your docs.

Explore Fern’s features

Now that your docs are live, explore these features to enhance them further.