title = "Packaging and distributing Spin applications"
template = "main"
date = "2022-03-14T00:22:56Z"
[extra]
url = "https://github.com/fermyon/spin/blob/main/docs/content/distributing-apps.md"
---

Packaging and distributing Spin applications is done using [Bindle](https://github.com/deislabs/bindle),
an open source aggregate object storage system. This allows the packaging of the
application configuration, components, and static assets together, and
takes advantage of the features of a modern object storage system.

To distribute applications, we first need a Bindle registry. You can
[install Bindle v0.8 release](https://github.com/deislabs/bindle/tree/main/docs#from-the-binary-releases),
or use the
[`autobindle`](https://marketplace.visualstudio.com/items?itemName=fermyon.autobindle)
VS Code extension (through the `Bindle: Start` command):

```bash
$ bindle-server --address 127.0.0.1:8000 --directory .
```

Let's push the application from the [quickstart](/quickstart) to the registry:

```bash
$ export BINDLE_URL=http://localhost:8080/v1
$ spin bindle push --file spin.toml
pushed: spin-hello-world/1.0.0
```

Now we can run the application using `spin up` directly from the registry:

```bash
$ spin up --bindle spin-hello-world/1.0.0
```

> A known error when running an application (with a high number of static assets)
> from Bindle on macOS is around
> [too many open files](https://github.com/fermyon/spin/issues/180). This issue
> can be worked around by setting a higher `ulimit -n` for the current shell
> session.

The application can also be prepared in a local directory before pushing to the
registry by running `spin bindle prepare`.
