> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lostmindai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Development

> Local preview, ports, deployment, and troubleshooting

<Info>
  **Prerequisite** You should have installed Node.js (version 18.10.0 or
  higher).
</Info>

Step 1. Install the CLI:

<CodeGroup>
  ```bash theme={null}
  npm i -g mintlify
  ```
</CodeGroup>

Step 2. From `apps/docs`, run the local server:

```bash theme={null}
mintlify dev --port 3004
```

The documentation website is now available at `http://localhost:3004`.

### Custom Ports

Mintlify uses port 3000 by default. We run on 3004 to avoid conflicts. You can customize with `--port`:

```bash theme={null}
mintlify dev --port 3333
```

You will see an error like this if you try to run Mintlify in a port that's already taken:

```md theme={null}
Error: listen EADDRINUSE: address already in use :::3000
```

## Keep the CLI updated

Update the CLI if local output diverges from production:

```bash theme={null}
npm i -g mintlify@latest
```

## Deployment

You should see the following if the deploy successfully went through:

<Frame>
  <img src="https://mintcdn.com/lostmindai/a0TTU40cZlwyA5PZ/images/checks-passed.png?fit=max&auto=format&n=a0TTU40cZlwyA5PZ&q=85&s=b6f2f8a60d9385a942adfde6f3de8dd3" style={{ borderRadius: '0.5rem' }} width="1100" height="346" data-path="images/checks-passed.png" />
</Frame>

## Troubleshooting

Here's how to solve some common problems when working with the CLI.

<AccordionGroup>
  <Accordion title="Site is not loading">
    Use Node v18+. Reinstall the CLI and try again.
  </Accordion>

  <Accordion title="No such file or directory on Windows">
    Go to the `C:/Users/Username/.mintlify/` directory and remove the `mint`
    folder. Then Open the Git Bash in this location and run `git clone
        https://github.com/mintlify/mint.git`.

    Repeat step 3.
  </Accordion>

  <Accordion title="Getting an unknown error">
    Try navigating to the root of your device and delete the \~/.mintlify folder.
    Then run `mintlify dev` again.
  </Accordion>
</AccordionGroup>
