> ## 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.

# Build & deploy

> Produce a production build and serve it

When your game is ready to ship, the build-and-serve path takes it from source to a running
production instance.

**1. Build for production**

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

The client and server are compiled into the output directories defined in your
[configuration](https://docs.nanoforge.eu/docs/cli/configuration/configuration-file.md) (`.nanoforge/client` and
`.nanoforge/server` by default). Override any path per run, for example:

```bash theme={null}
nf build --client-out-dir dist/client --server-out-dir dist/server
```

**2. Start the built game**

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

`nf start` launches the loader (the website that loads the game) and the server when enabled.
Choose the loader port with `-p`:

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

**3. Serve over HTTPS (optional)**

Provide a certificate and key to serve securely:

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

> [!NOTE]
>
> Scaffolding with `nf new --docker` generates Docker files so you can containerize the build for
> deployment.


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