# Distribute as a binary



The default Pear distribution model assumes users already have the `pear` runtime installed; they open `pear://<your-link>` to launch your application. For users who don't—or for app stores that want a self-contained download—Pear supports compiling a small bootstrap binary that pulls the platform and the application from the swarm at first launch. For why this stays small, see [Storage and distribution](/pear/explanation/storage-and-distribution).

The binary is bootstrap-only: it doesn't ship the application's code or assets, only the references needed to fetch them. Once a user has run any version, future releases reach them via the swarm without recompilation—the same delivery channel covered in [Deploy your application](/pear/how-to/operate-an-app/manual-deployment/deployment).

## Steps [#steps]

1. **Clone the [`pear-appling`](https://github.com/holepunchto/pear-appling/) template repository.** It's a CMake-based project that produces native binaries for macOS, Linux, and Windows from one source tree. (The repository is archived/read-only upstream, but remains usable as a template.)

2. **Edit `CMakeLists.txt` with your application metadata.** The `add_pear_appling()` call holds the application name (`NAME`), `pear://` link (`ID`), version (`VERSION`), author and description, plus the platform-specific identifiers and signing inputs (`MACOS_IDENTIFIER`, `MACOS_SIGNING_IDENTITY`, `WINDOWS_SIGNING_SUBJECT`, `WINDOWS_SIGNING_THUMBPRINT`, and so on). Replace each placeholder with your own value.

3. **Build the binary** with [`bare-make`](https://github.com/holepunchto/bare-make):

   ```sh
   npm i -g bare-make
   npm i
   bare-make generate
   bare-make build
   ```

   The output is one small binary—typically a few MB—that bootstraps Pear when launched. Run the same steps on each target OS to produce that platform's binary.

4. **Distribute the binary** via your channel of choice (GitHub Releases, an MSI/dmg, an app store, a download link). End users run it; on first launch it replicates the Pear platform and your application, then runs it. On subsequent launches, the swarm delivers any new version of the application—usually no recompile or redistribution is needed.

## When this is the wrong tool [#when-this-is-the-wrong-tool]

* **For users who already run Pear**, `pear://<your-link>` is the lighter path: zero compilation, instant updates.
* **For installing apps or binaries from a link**, the [`pear install`](/pear/reference/pear/cli#pear-install) command (or `npx pear-install pear://<key>` on machines without Pear) pulls a build from the swarm without compiling a bootstrap binary yourself. See [Installing applications](/pear/explanation/storage-and-distribution#installing-applications).
* **For mobile distribution**, `pear-appling`'s bootstrap-binary model doesn't apply—mobile apps ship through the App Store and Google Play (or TestFlight / Play Console internal testing for pre-release builds), not as a standalone compiled binary. See [Submit to app stores](/pear/how-to/operate-an-app/build-and-package/submit-to-app-stores#ios). For the raw `Worklet`/`IPC` primitive `pear-mobile` builds on, see [Bare Kit](/bare/reference/bare/bare-kit).
