> 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/hosting/hosting.md).

# Host Overview

Choose a terminal, backend, or web host, and understand application identity, configuration directories, and plugin lifecycle.

The host provides process entry, configuration, service container, logs and start-stop lifecycle, and the plugin provides business capabilities. Keeping the host entry simple allows the same business component to be reused in different deployment solutions; the prerequisite for reuse is that the target host has the interaction or protocol capabilities it needs.

## Choose a Host

| Type     | main entrance                                                                                               | Suitable for the scene                                                                 | read                                                           |
| -------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
| Terminal | Interactive commands                                                                                        | Development and debugging, manual diagnostics, and reproduction of background behavior | [Terminal Host](/documentation/en/hosting/terminal.md)         |
| Daemon   | long term [worker](https://github.com/Zongsoft/framework/blob/main/Zongsoft.Core/src/Components/IWorker.cs) | Consume messages, execute jobs, and system services                                    | [Background Service Host](/documentation/en/hosting/daemon.md) |
| Web      | HTTP pipeline                                                                                               | Controller, interface, gateway                                                         | [Web Host](/documentation/en/hosting/web.md)                   |

The terminal can simulate background business, but the web controller and middleware still require a web host; plugins that use terminal input should not be started unconditionally in non-interactive services.

## How the Current Source Code Is Built

`Directory.Build.props` of the hosting root currently sets `net10.0`, and enables `ZongsoftFrameworkPathReferenced`, referencing the class library from the corresponding output of the adjacent framework. Before building the host, you need to prepare a framework product that matches the target framework and compilation configuration.

The framework library itself may support .NET 8, 9, 10, this does not mean that every host project and all dependencies use the same target. When switching versions, you must also check the project, central package version and release script, see [Environmental preparation](/documentation/en/get-started/prerequisites.md).

## Running Directory and Identity

Taking the actual deployment list of hosting/web/default as an example, Main.plugin is placed in plugins, and other configurations are selected by variables such as scheme, site, environment, etc.; see [Deploy Your First Plugin](/documentation/en/get-started/deploy-first-plugin.md) for the deployment location of Discussions.

Source: [hosting/web/default/.deploy](https://github.com/Zongsoft/hosting/blob/main/web/default/.deploy#L7) (excerpt; see source for context).

{% code title=".deploy" %}

```ini
#@import ../web.deploy

[plugins]
nuget:Zongsoft.Plugins/plugins/Main.plugin
```

{% endcode %}

The published entry point is Zongsoft.Hosting.Web.dll, and its dependency list and runtime configuration are generated with dotnet publish. Plugins and.option files are completed by the deployment manifest, and the deployment cannot be deemed complete simply by the existence of the assembly file.

The executable file name, runtime application name, `host` and `site` are not necessarily the same. The application name affects configuration and upgrade matching, and `host/site` participates in deployment and running configuration selection. The current application name of the terminal is `zongsoft.terminal`, but the entry assembly is `Zongsoft.Hosting.Terminal`.

The working directory, application directory and content root path should also be understood separately, see [basic concepts](/documentation/en/overview/concepts.md#host). When starting a service from a different directory, incorrect relative paths can cause configuration, database, or plugin resources to resolve to different locations.

## Verification of a Complete Boot

First confirm that the process is started correctly, then check plugin loading, builtin and service registration, and finally verify the business call. Some providers delay establishing a connection until first access, exposing endpoint, permissions, or DLL version errors.

When stopping, the host notifies the [worker](https://github.com/Zongsoft/framework/blob/main/Zongsoft.Core/src/Components/IWorker.cs) to stop and release the resources it owns. Business workers should stop receiving new tasks, pass cancellations, and wait for necessary in-flight operations; they should not rely on force exit to replace normal lifecycle design.

Next step: [Deploy a Host](/documentation/en/hosting/deployment.md), [Container Environments](/documentation/en/hosting/containerization.md), [Plugin hosting integration](/documentation/en/framework/plugins/hosting.md).

Source references: [hosting repository](https://github.com/Zongsoft/hosting).


---

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