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

# start

> Start a built NanoForge project

## Overview

`nf start` serves a previously built NanoForge project. It launches the loader (the website that
loads the game) and, when enabled, the server. It can also serve over HTTPS when given a
certificate and key.

## Usage

```bash theme={null}
nf start
```

## Options

| Option | Description |
| - | - |
| `-d, --directory <directory>` | Working directory of the command. |
| `-c, --config <config>` | Path to the configuration file. Default: `nanoforge.config.json`. |
| `-p, --port <port>` | Port of the loader (the website that loads the game). |
| `--client-dir <clientDirectory>` | Directory of the built client. |
| `--server-dir <serverDirectory>` | Directory of the built server. |
| `--watch` | Run in watch mode. Default: `false`. |
| `--cert <cert>` | Path to the TLS certificate for HTTPS. |
| `--key <key>` | Path to the TLS key for HTTPS. |

## Examples

**Start on a custom port:**

```bash theme={null}
nf start --port 8080
```

**Start over HTTPS:**

```bash theme={null}
nf start --cert ./certs/cert.pem --key ./certs/key.pem
```

> [!NOTE]
>
> Environment variables (for example server addresses and ports) are read from a `.env` file at the
> project root when the game starts. See [Environment
> variables](https://docs.nanoforge.eu/docs/cli/configuration/environment-variables.md).

> [!NOTE]
>
> When the workspace sets `network: "p2p"`, `nf start` adds `NANOFORGE_NETWORK_MODE=p2p` to the
> environment of both apps: the server app only pairs players, and the game runs in the host
> player's browser.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.