Local Development

Preview changes locally to update your docs

Prerequisite: Please install Node.js (version 18 or higher) before proceeding.

Follow these steps to install and run the Fern CLI:

Step 1: Install the Fern CLI:

$npm i -g fern-api

Step 2: Navigate to the docs directory (where the fern folder is located) and execute the following command:

$fern docs dev

A local preview of your documentation will be available at http://localhost:3000.

Some features (e.g. search) are disabled in the local development environment.

Custom ports

By default, Fern uses port 3000. You can customize the port Fern runs on by using the --port flag. For example, to run Fern on port 3002, use this command:

$fern docs dev --port 3333

If you attempt to run Fern on a port that’s already in use, it will use the next available port: