2022-10-06 09:15:30 +00:00
---
2023-10-18 10:59:43 +00:00
title: 'nuxi dev'
2022-10-06 09:15:30 +00:00
description: The dev command starts a development server with hot module replacement at http://localhost:3000
2023-10-18 10:59:43 +00:00
links:
- label: Source
icon: i-simple-icons-github
to: https://github.com/nuxt/cli/blob/main/src/commands/dev.ts
size: xs
2022-10-06 09:15:30 +00:00
---
2023-10-18 10:59:43 +00:00
```bash [Terminal]
2023-03-07 12:20:43 +00:00
npx nuxi dev [rootDir] [--dotenv] [--log-level] [--clipboard] [--open, -o] [--no-clear] [--port, -p] [--host, -h] [--https] [--ssl-cert] [--ssl-key]
2022-04-06 05:56:08 +00:00
```
The `dev` command starts a development server with hot module replacement at [http://localhost:3000 ](https://localhost:3000 )
Option | Default | Description
-------------------------|-----------------|------------------
`rootDir` | `.` | The root directory of the application to serve.
2022-09-26 10:36:10 +00:00
`--dotenv` | `.` | Point to another `.env` file to load, **relative** to the root directory.
2022-04-06 05:56:08 +00:00
`--clipboard` | `false` | Copy URL to clipboard.
`--open, -o` | `false` | Open URL in browser.
2022-05-30 12:37:41 +00:00
`--no-clear` | `false` | Does not clear the console after startup.
2022-04-06 05:56:08 +00:00
`--port, -p` | `3000` | Port to listen.
`--host, -h` | `localhost` | Hostname of the server.
`--https` | `false` | Listen with `https` protocol with a self-signed certificate by default.
`--ssl-cert` |`null` | Specify a certificate for https.
`--ssl-key` |`null` | Specify the key for the https certificate.
The port and host can also be set via NUXT_PORT, PORT, NUXT_HOST or HOST environment variables.
2023-09-26 13:53:07 +00:00
Additionally to the above options, `nuxi` can pass options through to `listhen` , e.g. `--no-qr` to turn off the dev server QR code. You can find the list of `listhen` options in the [unjs/listhen ](https://github.com/unjs/listhen ) docs.
2022-07-06 18:39:02 +00:00
This command sets `process.env.NODE_ENV` to `development` .
2022-09-06 09:45:14 +00:00
2023-10-18 10:59:43 +00:00
::callout
2022-09-06 09:45:14 +00:00
If you are using a self-signed certificate in development, you will need to set `NODE_TLS_REJECT_UNAUTHORIZED=0` in your environment.
::