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

# Build for another host

> Build a static Lettercamp publication, configure generated asset URLs, and upload the output to another hosting provider.

For Lettercamp Cloud, use [`npx lettercamp check`](https://www.lettercamp.com/docs/cli/check) to verify
compatibility before deploying. The standalone build below uses your local
dependencies and writes files for another host.

Run the build from your publication directory:

```bash theme={null}
npx lettercamp build --site https://example.com
```

Replace `https://example.com` with your public site URL. The CLI uses its origin
(scheme and hostname, plus port if present) for site metadata and its pathname
as the site's base path. The URL must use HTTP or HTTPS, without credentials,
query parameters, or a fragment.

| Option | Description | Default |
| - | - | - |
| `--site <url>` | Public site URL for metadata. | Required |
| `--out-dir <directory>` | Directory for the generated static site, relative to your publication directory unless absolute. | `dist` |
| `--assets-prefix <url>` | Base URL for generated assets, such as a versioned CDN location. | Unset |
| `--remote-assets-only` | Check Cloud asset requirements and exclude `public/` files. Does not upload assets. | Off |

## Host under a subfolder

Include the path in your site URL:

```bash theme={null}
npx lettercamp build --site https://example.com/blog
```

Serve the output at `/blog/` on your host. Lettercamp prefixes publication links
with that base path. Use full URLs for links to pages outside the publication.

## Output and assets

By default, builds copy `public/` into the output. For example,
`public/images/cover.jpg` is served at `/images/cover.jpg` on a root-hosted site.
Local preview also serves these files. The bundled starter's images and fonts
work with this default; you do not need a Cloud account or asset upload.

Upload the entire output directory to your static host, including generated
JavaScript and copied public files. Pages use directory-style URLs with trailing
slashes, so your host must serve each directory's `index.html`.

Choose a different output directory:

```bash theme={null}
npx lettercamp build --site https://example.com --out-dir ./build
```

Use a CDN for generated assets:

```bash theme={null}
npx lettercamp build --site https://example.com --assets-prefix https://cdn.example.com/v1
```

Upload the generated assets to that CDN location as part of your deployment.
The asset prefix applies only to generated assets; it does not upload them or
rewrite references to files copied from `public/`.

Use `--remote-assets-only` to check a publication that already uses hosted asset
URLs before [GitHub publishing](https://www.lettercamp.com/docs/git.md). This mode rejects local media and fonts,
including `design.typography.localFonts: true`. CLI
[deployment](https://www.lettercamp.com/docs/publishing/deploy.md) prepares supported local images automatically
before running these checks.

The build writes static files for your hosting provider. It does not deploy them.
Use a dedicated output directory: the build can replace its contents. The CLI
rejects output paths that would replace your publication root, its ancestors, or
overlap `pages/`, `components/`, or `public/`.


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