Prerequisite: Please install Node.js (version 19 or higher) before proceeding.
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
Alternatively, if you do not want to install the CLI globally you can use a run script available:
npx mintlify dev
Yarn’s “dlx” run script requires yarn version >2. See here for more information.
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. To run Mintlify on port 3333, for instance, use this command:
mintlify dev --port 3333
If you attempt to run on a port that’s already in use, it will use the next available port:
Port 3000 is already in use. Trying 3001 instead.

Versions

Please note that each CLI release is associated with a specific version of Mintlify. If your local website doesn’t align with the production version, please update the CLI:
npm i -g mintlify@latest
The CLI can assist with validating reference links made in your documentation. To identify any broken links, use the following command:
mintlify broken-links

Deployment

If the deployment is successful, you should see the following:

Code Formatting

We suggest using extensions on your IDE to recognize and format MDX. If you’re a VSCode user, consider the MDX VSCode extension for syntax highlighting, and Prettier for code formatting.

Troubleshooting