> This page is for 文档.

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For task-scoped instructions for coding agents working in a Fern project, see https://buildwithfern.com/learn/home/fern-instructions.md.

# Export your docs

> Download a copy of your live docs site as static HTML, Markdown, or a PDF for offline viewing and internal distribution.

`fern docs export` downloads a snapshot of your live Fern-hosted docs site, for readers who can't reach it, such as air-gapped environments or a compliance archive. After you publish changes, export again to include them.

## Prerequisites

* Fern CLI 5.197.0 or later
* A site [published to Fern hosting](/learn/docs/preview-publish/publishing-your-docs)
* A Fern account in the `organization` from `fern.config.json`, via [`fern login`](/learn/cli-api-reference/cli-reference/general-commands#fern-login) or `FERN_TOKEN` in CI

## Export your site

Run the command from your Fern project:

```bash
fern docs export                # static HTML site (default)
fern docs export --format md    # each page's Markdown and llms.txt
fern docs export --format pdf   # one PDF, the same as the Dashboard PDF export
```

The CLI writes to a folder named after the site, such as `docs-acme-com-html`. Links in an HTML export are relative file paths, so the folder works on any static host, such as Amazon S3 or nginx, without rewrite rules. To view it locally:

```bash
npx serve docs-acme-com-html
```

Use `--output` to choose the destination and `--instance` to pick an instance when `docs.yml` lists more than one. For PDF cover, header, and footer options, see the [command reference](/learn/cli-api-reference/cli-reference/docs-commands#fern-docs-export).

## Limits

* Each organization can run 150 exports per day across HTML, Markdown, and PDF, from the CLI and the Dashboard.
* `fern docs export` only works for Fern-hosted sites. For [self-hosted docs](/learn/docs/self-hosted/overview), use the container's [static export](/learn/docs/self-hosted/previews).

## Security

An export has no authentication. Anyone with the files can read every page in them.

> **Warning**
>
> If your site uses [authentication](/learn/docs/authentication/overview) or [role-based access control](/learn/docs/authentication/features/rbac), the export includes gated pages. Share it only with readers allowed to see all your content.