--- title: Document Publication --- The document publication lifecycle handles all steps for publishing a document. Below is a diagram for the document publication lifecycle. You don't need to fully understand everything going on right now, but as you learn and build more, it will be a useful reference. ![Document Publication Lifecycle](/customising/server/document-lifecycle/assets/document-publication-lifecycle.png) 1. Start "Prepare Publish" phase where you still can modify the document, validate data and throw errors back to the callee 2. Call metadata plugin hook `onPreparePublish` (modify metadata property, validation) (Deprecated in: [`release-2026-03`](/operations/releases/release-2026-03/)) 3. Call server hook [`preparePublishHook`](/customising/server/server-hooks/llms.txt#publication-hooks) (modify document, validation). 4. Start "Publication" phase 5. Save the publication on the database 6. Call server event [`document.update`](/customising/advanced/server-events/llms.txt#available-events) 7. Call server event [`document.publish`](/customising/advanced/server-events/llms.txt#available-events) 8. Call server hook [`postPublishHook`](/customising/server/server-hooks/llms.txt#publication-hooks) (notify other systems).