| title | Dev Environment |
|---|---|
| description | How I run this docs site locally and my setup for editing |
| icon | laptop-code |
| og:image | /images/hero-light.png |
import Prerequisites from '/snippets/prerequisites.mdx';
If you have a legacy `mint.json` file, run the Mintlify upgrade command to convert it to `docs.json` and delete the old file.npm i -g mintlifyyarn global add mintlifyThen navigate to wherever docs.json lives and start the dev server:
mintlify devOpen localhost:3000 and you're live.
Mintlify uses port 3000 by default. To use a different port:
mintlify dev --port 3333If the port is already in use, it automatically picks the next one:
Port 3000 is already in use. Trying 3001 instead.Each CLI version is tied to a specific Mintlify release. If the local preview looks different from production, update:
npm i -g mintlify@latestyarn global upgrade mintlifyBefore pushing, run this to catch any broken internal links:
mintlify broken-linksPush to main and the Mintlify GitHub app deploys automatically. You can also deploy manually from the dashboard.
If the deploy succeeds, you'll see this on the commit:
I use VSCode with these extensions:
This is usually an outdated Node version:
1. Remove mintlify: `npm remove -g mintlify`
2. Upgrade to Node v19+
3. Reinstall: `npm install -g mintlify`
Delete the `~/.mintlify` folder and run `mintlify dev` again. This clears the local cache and fixes most mystery issues.
