> For the complete documentation index, see [llms.txt](https://docs.zongsoft.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zongsoft.com/documentation/en/overview/deployment.md).

# Deployment Model

Understand the overall model of deployment, packaging, and upgrades in Zongsoft.

Zongsoft's deployment model revolves around plugin-based applications. Deployment is not simply copying the compilation output, but assembling plugins, configurations, mappings, certificates and resources into the target directory of the host according to rules.

## Deploy

Deployment is performed by the `dotnet-deploy` tool and the rules are written in the `.deploy` file. The deployment file describes the source files, NuGet packages, target directories, and filter conditions.

Typical deployment content includes:

* master plugin file.
* Plugin assembly.
* Options configuration file.
* data mapping file.
* Localized resources.
* Certificate or site configuration.

## Pack

After the deployment is completed, you can use `dotnet-pack` to make the release directory into a common Linux package format:

* `.tar.gz`
* `.deb`
* `.rpm`

The packaging phase focuses on installation paths, systemd services, lifecycle scripts, package metadata, and file permissions.

## Automatic Upgrades

Automatic upgrades are supported by the upgrading component in the framework repository and the `dotnet-upgrade` tool. An upgrade package typically contains application release files, manifests, checksums, and deployment executor information.

## Recommended Path

During the development phase, the `terminal` host is preferred for debugging plugins; when jointly debugging Web APIs, the `web/default` host is used; when preparing for deployment, the `daemon` or `web` host is used with deployment, packaging, and upgrade tools.

## Do Not Mix the Three Types of Products

| stage            | input                                                           | Output and acceptance                                            |
| ---------------- | --------------------------------------------------------------- | ---------------------------------------------------------------- |
| deploy           | Host release files, plugin packages and solution configurations | Startable runtime directory to complete a business call          |
| Install Packages | Run directory and installation metadata verified                | tar/deb/rpm, check paths, services and upgrade/uninstall scripts |
| Upgrade package  | New version run file and publishing identity                    | ZIP/manifest, check discovery, handover and new process health   |

The compilation configuration in the deployment parameters, the product identity of the installation package, and the version distribution name of the upgrade package have their own purposes, and the same values should not be applied just because the options have the same name. Persistent data and environment secrets should also not be collected indiscriminately into packages.

Specific operations: [Deploy a Host](/documentation/en/hosting/deployment.md), [Packaging Tool](/documentation/en/tools/packager.md), [Automatic Upgrades](/documentation/en/framework/upgrading.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zongsoft.com/documentation/en/overview/deployment.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
