# Application startup and per-site module activation

Source: https://zotonic.com/docs/2926/application-startup-and-per-site-module-activation

URI: https://zotonic.com/id/2926

Language: en

OTP application startup concerns the application and its processes. Zotonic module activation concerns the feature within an individual site.

A module can be compiled and available to the VM but inactive on `garden`. Conversely, activating a module can start per-site behavior, attach observers, and trigger installation or schema work. Treat activation as a state-changing operation.

Use an OTP supervisor for application-level services when appropriate. Use the site's/module's supported lifecycle for state that belongs to one site. Pass the correct site context rather than storing a single global site value in a shared process.

When debugging startup, distinguish a missing application, a failed site, an inactive module, and a crashing worker. Each has a different fix. See [Run work outside a request](/id/2963).

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/2926?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/2926?language=en>)
