diff --git a/fern/products/cli-api-reference/pages/docs-commands.mdx b/fern/products/cli-api-reference/pages/docs-commands.mdx index b1dc4c443..5b99c93e2 100644 --- a/fern/products/cli-api-reference/pages/docs-commands.mdx +++ b/fern/products/cli-api-reference/pages/docs-commands.mdx @@ -77,7 +77,7 @@ These commands build, preview, and publish a Fern documentation site, and valida - Use `fern docs dev` to run a local development server to preview your docs. The server includes the [role selector and password login](/learn/docs/preview-publish/preview-changes#local-development) for sites that use role-based access control or password protection. + Use `fern docs dev` to run a local development server to preview your docs. The server includes the [role selector and password login](/learn/docs/preview-publish/preview-changes#local-development) for sites that use role-based access control or password protection. The server is for previewing on your own machine, not for hosting docs: to serve docs to readers, publish them with [`fern generate --docs`](#fern-generate---docs). ```bash diff --git a/fern/products/docs/pages/preview-publish/preview-changes-locally.mdx b/fern/products/docs/pages/preview-publish/preview-changes-locally.mdx index e4905defd..a27ef4e7f 100644 --- a/fern/products/docs/pages/preview-publish/preview-changes-locally.mdx +++ b/fern/products/docs/pages/preview-publish/preview-changes-locally.mdx @@ -48,6 +48,8 @@ Your documentation will be available at `http://localhost:3000` (default) or the Some features are disabled in local development, including search and SEO (favicon, auto-generated meta tags, etc.). +`fern docs dev` is for previewing on your own machine, not for serving docs to readers. Don't expose it to other people through a reverse proxy, tunnel, or open port: it isn't built for public traffic, and it shows [role-gated content](/learn/docs/authentication/features/rbac#preview-as-a-role) to anyone who can reach it. To host docs, [publish them](/learn/docs/preview-publish/publishing-your-docs) with `fern generate --docs`. To share unpublished changes, use a [preview link](#preview-links). + If your docs use [role-based access control](/learn/docs/authentication/features/rbac#preview-as-a-role), the local server has the same role selector as a preview link, so you can view the site as a specific viewer and check role-gated pages and navigation. With no role selected, it shows all content. To test password protection locally, set `FERN_AUTH_TYPE=password` and `FERN_AUTH_SECRET` to the password before starting the server: ```bash