Quick Start: Install and run the Payload Website Template
mainThe template is designed as a full-stack application where the Payload backend and a Next.js frontend are served together.
Core Backend Components
- Collections: Includes
Users(auth-enabled),Posts(draft-enabled, layout builder enabled),Pages(draft-enabled, layout builder enabled),Media(uploads enabled with pre-configured sizes), andCategories(nested taxonomy). - Globals: Includes
HeaderandFooterfor managing site-wide navigation and footer data. - Access Control: Pre-configured to allow everyone to see published
postsandpages, while restricting creation/editing tousers.
Core Frontend Components
- Next.js App Router: Powers the production-ready website.
- Layout Builder: Uses pre-designed blocks (Hero, Content, Media, Call To Action, Archive) to build unique page layouts.
- Lexical Editor: Provides a rich text experience supporting blocks, media, and links.
- Previewing: Supports both Draft Preview (using Versions with
drafts: true) and Live Preview (with SSR support). - On-demand Revalidation: Uses Next.js revalidation triggered by
afterChangehooks to update the static frontend when content is published.
# Method 1: Recommended (via Payload Cloud)
# Go to Payload Cloud and clone this template: https://payloadcms.com/new/clone/website
# Method 2: Using create-payload-app CLI
pnpx create-payload-app my-project -t website
# Method 3: Using git sparse-checkout
git clone -n --depth=1 --filter=tree:0 https://github.com/payloadcms/payload my-project && cd my-project && git sparse-checkout set --no-cone templates/website && git checkout && rm -rf .git && git init && git add . && git mv -f templates/website/{.,}* . && git add . && git commit -m "Initial commit"
# Local Development Steps
cd my-project
cp .env.example .env
pnpm install && pnpm dev