-   [](https://platform.exaloop.io/)
-   Databases
-   [DuckDB](https://platform.exaloop.io/db/duckdb/)
-   Deployment

# Deploy DuckDB Applications and Extensions

Deploy either a [loadable extension](https://platform.exaloop.io/db/duckdb/extension/) for an existing DuckDB host or an [embedded application](https://platform.exaloop.io/db/duckdb/client/) with its own database engine. Both need compatible native dependencies. Check the [platform and DuckDB requirements](https://platform.exaloop.io/db/reference/#compatibility) for the destination before building a release artifact.

## Loadable Extensions

An extension registers its functions against the database passed to its initializer. Those registrations belong to the running database instance; they are not saved in a database file. Tables provide durable state; module globals last only as long as the host process.

The extension requires matching Codon runtime libraries, but not Python. A loaded library remains in use for the lifetime of its host process, so replacement requires a host restart rather than overwriting the active file.

## Embedded Deployment

Build the application from the [client tutorial](https://platform.exaloop.io/db/duckdb/client/):

```sh title="Terminal"
exaloop --with duckdb build -release -o application application.codon
```

Deploy the compiled application, installed plugin directory, and matching Codon runtime libraries. Keep their runtime-library search paths valid. The installed plugin includes DuckDB's license. No Python DuckDB wheel is needed.

Check [compatibility](https://platform.exaloop.io/db/reference/#compatibility) for supported platforms and database versions before deploying.

## Next Steps

-   [Check native library requirements](https://platform.exaloop.io/start/distribution/#runtime-only-packages) before moving an application to another host.
-   [Prepare a production deployment](https://platform.exaloop.io/production/) with a repeatable package and rollback procedure.

Source: https://platform.exaloop.io/db/duckdb/deployment/
