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

# Deploy to Lettercamp

> Create a site on your first deployment, update that site's source on later deployments, and resume interrupted uploads.

Publish your local Lettercamp publication and get a live `lettercamp.site` address.

To edit an existing cloud site and review changes before making them live, use
[`connect`, `pull`, and `push`](https://www.lettercamp.com/docs/cli/connect). `push` builds a cloud preview;
`deploy` publishes directly.

> [!NOTE]
>
> Run [`npx lettercamp check`](https://www.lettercamp.com/docs/cli/check) before publishing, especially after
> changing custom components. It checks imports and builds a deployment copy
> without signing in or uploading. Agents can use `--json` to read the issues and
> suggested fixes.

Run this command from your publication folder:

```bash theme={null}
npx lettercamp deploy
```

The CLI checks component imports, prepares referenced local images, checks source
files (including drafts), and builds a temporary copy before uploading. Import
errors include file locations and fixes. A failed local check leaves your hosted
site untouched. See [Local images and Cloud assets](#local-images-and-cloud-assets)
for supported files and preparation steps.

The CLI welcomes you and verifies your saved login. In an interactive terminal,
it shows your name and email so you can continue, sign in with another account,
or cancel before the build starts. If you are not signed in, it opens browser
login first.

The first deployment from a folder creates a new site. It never offers an existing
site to replace. Accept **My Blog** as the site name or enter your own, then choose
one of the suggested `lettercamp.site` addresses or enter a different one.
Addresses are checked when the site is created; if a name or address is rejected,
the CLI lets you edit it and try again.

In selection menus, use the up and down arrow keys or type a number, then press
Enter. Press Escape or Ctrl+C to cancel. Terminals without cursor controls use
numbered choices.

Terminal output uses highlighted selections and colored progress, success, and
error messages. Set `NO_COLOR=1` to turn colors off. Redirected output stays plain.

The CLI saves a deployment destination for this folder locally. Later deployments need only
`npx lettercamp deploy`: it uploads your local source, builds on Lettercamp, waits for
the result, and prints your live URL. You do not need Git or a GitHub account.
Your existing site stays live if the build fails.

If that destination is unavailable to your account, deployment stops instead of
choosing another site. Check your login before creating a replacement. A copied
or moved folder without a saved deployment destination starts with a new site.
Choosing a destination for [`upload`](https://www.lettercamp.com/docs/cli/upload) does not connect the folder
for deployment or change where `deploy` publishes.

If the site's source has changed in Cloud since your last deployment, the CLI
stops before uploading. Review those edits in Cloud. The CLI does not merge or
offer to overwrite them; you can publish your local folder as a separate site
with `--new`.

## Deploy as a new site

To create another site from this folder, run:

```bash theme={null}
npx lettercamp deploy --new
```

The previous site stays unchanged. After creation, the new site becomes this
folder's destination for future `deploy` commands. Complete an unfinished
deployment with `npx lettercamp deploy` before using `--new`.

If site creation was interrupted, rerun `npx lettercamp deploy` to resume the
saved creation request. It reuses the request instead of creating a duplicate.
If creation is rejected, the previous deployment destination is retained.

## Local images and Cloud assets

`deploy` uploads files in `public/` with their paths intact, subject to your
plan's limits. For example, `public/images/cover.jpg` is available at
`/images/cover.jpg`. This includes local images, fonts, and downloads; supported
images are optimized during the Cloud build. The default starter's local assets
can stay in place.

Referenced JPEG, PNG, WebP, AVIF, and GIF images outside `public/` use the media
library. This includes branding and frontmatter images, Markdown images, image
component properties, and supported literal references in React components and CSS.
Relative image paths resolve from the source file that references them.

These images must stay inside the publication's `pages/`, `assets/`,
`components/`, `lib/`, or `styles/` folders. The CLI replaces image references with
hosted URLs in the deployment copy and leaves your local files unchanged.
Unchanged images are reused for the same destination site. Uploads follow your
site's image-size limit.

For hosted assets instead, use the optional
[`--remote-assets` setup](https://www.lettercamp.com/docs/cli/new#optional-start-with-remote-assets), or
[upload images and fonts](https://www.lettercamp.com/docs/cli/upload.md) and use their returned URLs. Keep SVG and
ICO files in `public/` or use hosted URLs. Browser-only expressions are not
rewritten; dynamically constructed paths must point to a deployed public file
or a hosted URL.

Standalone [static builds](https://www.lettercamp.com/docs/publishing/build.md) continue to support local assets.

## Files included in a deployment

Deployments include `settings.json` and files inside `pages/`, `components/`,
`lib/`, `styles/`, and `assets/`. Keep imported source files within these folders.
Your `package.json`, `tsconfig.json`, and local dependencies are not included.
Custom components must follow the [supported import rules](https://www.lettercamp.com/docs/react-components.md#supported-imports):
relative local imports, CSS or Sass, and React instead of external npm packages.
Local deletions within this set also remove the corresponding hosted source files.
Files outside this set, such as the remote README, stay untouched.

Hidden files and folders, `node_modules`, `dist`, `build`, `coverage`, and private
key files (`.pem`, `.key`, `.p12`, `.pfx`) are excluded. Symlinks are rejected.
Source uploads support up to 2,000 files, 5 MB per file, and 10 MB total.
Images outside `public/` are excluded from the source upload and its size budget;
referenced supported images are uploaded separately. Unreferenced images outside
`public/` are not uploaded. The `assets/` source folder is not a public file server.
Public files are uploaded separately and checked against your plan's limits.

## Resume a deployment

If your connection drops or you stop the CLI, run `npx lettercamp deploy` again.
It resumes the saved upload or checks the existing deployment. Local edits made
after that upload are included the next time you deploy. If a build fails, your
source may already be saved remotely; fix the local files and deploy again.

## Publish through GitHub

Sites connected to an external GitHub repository publish through that repository.
Push your changes there instead of uploading source with `npx lettercamp deploy`.
Cloud does not install your repository's npm dependencies. Follow the same
[custom component guidance](https://www.lettercamp.com/docs/react-components.md#supported-imports), and commit
the component files and stylesheets along with your pages. Automatic media
library uploads happen only with `lettercamp deploy`; GitHub builds use the
files and asset URLs already committed to the repository.
See [GitHub publishing](https://www.lettercamp.com/docs/git.md) to connect a repository.

Next, connect a [custom hostname](https://www.lettercamp.com/docs/publishing/domains.md) or a [subfolder](https://www.lettercamp.com/docs/publishing/subfolders.md).


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