Local Development
Preview changes locally to update your docs
Prerequisite: Please install Node.js (version 19 or higher) before proceeding.
Installation
Step 1: Install the Mintlify CLI:
Step 2: Navigate to the docs directory (where the docs.json
file is located) and execute the following command:
If you prefer not to install the CLI globally, you can use one of these run scripts instead:
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:
If you attempt to run Mintlify on a port that’s already in use, it will automatically select the next available port:
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:
Link Validation
The CLI includes a tool to help validate reference links in your documentation. To check for broken links, use:
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:
- MDX VSCode extension for syntax highlighting
- Prettier for code formatting
Troubleshooting
Was this page helpful?