| name | deployment |
| description | This skill should be used when the user asks to "deploy Payload to production", "deploy Payload to Vercel", "dockerize a Payload app", "build without a database connection", "add rate limiting", "prevent API abuse", "optimize Payload performance", or "configure serverless database connections". Covers the production build, Vercel and Docker/Node self-host targets, building without a live DB, locking down REST/GraphQL, and query performance. |
PayloadCMS — Production & Deployment
Ship a PayloadCMS v3 app to production. Payload runs anywhere Next.js runs — it is a Next.js app, so next build is the build. This skill covers the production build, deploy targets, building without a DB connection, hardening the API against abuse, and query performance.
1. Production build
Payload's build is Next.js's build. The scaffolder wires package.json so pnpm build runs next build:
pnpm build
pnpm start
Required environment in every production environment:
PAYLOAD_SECRET=<long-random-string>
DATABASE_URI=postgres://user:pass@host:5432/db
NEXT_PUBLIC_SERVER_URL=https://cms.example.com
NODE_ENV=production
PAYLOAD_SECRET must be long and impossible to guess — rotating it logs every user out and invalidates reset tokens. Set serverURL in the config (absolute, protocol + domain, no path) so emails, previews, and CORS resolve correctly:
({
: process..,
})
Production-hardened config excerpt — low depth, capped GraphQL, absolute URL:
CI build with no DB reachable, then generate static pages at container start: