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

Installation

Step 1: Install the Mintlify CLI:

npm i -g mintlify

Step 2: Navigate to the docs directory (where the docs.json file is located) and execute the following command:

mintlify dev

If you prefer not to install the CLI globally, you can use one of these run scripts instead:

npx mintlify dev

Yarn’s “dlx” run script requires Yarn version 2 or higher. For more information, see the Yarn documentation.

Once started, a local preview of your documentation will be available at http://localhost:3000.

Custom Ports

By default, Mintlify uses port 3000. You can customize the port using the --port flag. For example, to run Mintlify on port 3333, use this command:

mintlify dev --port 3333

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

Port 3000 is already in use. Trying 3001 instead.

Version Management

Each CLI release corresponds to a specific version of Mintlify. If your local preview doesn’t match the production version, update the CLI using one of these commands:

npm i -g mintlify@latest

The CLI includes a tool to help validate reference links in your documentation. To check for broken links, use:

mintlify broken-links

Deployment

After a successful deployment, you should see a confirmation screen similar to this:

Code Formatting

For the best development experience, we recommend using IDE extensions that support MDX. For Visual Studio Code users, we suggest:

Troubleshooting