For Payload
Payload on Edge, inside your Next.js app
Free to sign up. No egress fees on any product.
Why Payload on Edge
Payload runs here exactly as it runs on your laptop
Schema in TypeScript
Collections, fields and access control are code in your repo, reviewed and versioned like everything else.Embedded or standalone
Run Payload inside your Next.js app on one VM, or split the admin and front end across two. Both are first-class.The official S3 adapter
@payloadcms/storage-s3 takes a custom endpoint, so uploads and generated sizes live in an Edge Storage bucket.Postgres or MongoDB
Run either on the same VM for small projects, or on a dedicated database VM over a private network.A global CDN in front
Pages, static assets and public API responses cache in 988 locations. The admin UI goes to origin.Agent-deployable
Ask the Edge agent API to deploy your Payload and Next.js app to a domain: VM, DNS, CDN, SSL and bucket.
Reference architecture
How Payload maps to Edge
Readers
pages served from cache
Editors
/admin, straight to origin
acme.dev
pages, _next/static, public API
media.acme.dev
uploads, resized at the edge
next start :3000
Payload 3 · Next.js · s-4vcpu-8gb
postgres :5432
or MongoDB, same VM
acme-uploads
@payloadcms/storage-s3
- Compute
Runs Payload and Next.js in one Node process, with the database alongside.
- Storage
Holds upload collections and every generated image size.
- CDN
Caches the front end and public API; the admin UI goes to origin.
- Image optimisation
Optional: skip Payload's resize step and transform at the edge.
- DNS
Anycast DNS for the apex, www and preview branches.
- Shield
Validates form submissions in a Payload hook with one call.
- Assist
AI answers from your published content on the front end.
Deploy
Payload on Edge in five steps
- 01
Wire uploads to Edge Storage
Serve files from your CDN domain rather than proxying them through Payload. Uploads then never touch the VM on the way out.
payload.config.tsimport { buildConfig } from 'payload' import { postgresAdapter } from '@payloadcms/db-postgres' import { s3Storage } from '@payloadcms/storage-s3' export default buildConfig({ db: postgresAdapter({ pool: { connectionString: process.env.DATABASE_URI }, }), plugins: [ s3Storage({ collections: { media: { disablePayloadAccessControl: true, generateFileURL: ({ filename }) => `https://media.acme.dev/${filename}`, }, }, bucket: 'acme-uploads', config: { endpoint: 'https://storage.edge.network', region: 'us-east-1', forcePathStyle: true, credentials: { accessKeyId: process.env.EDGE_KEY!, secretAccessKey: process.env.EDGE_SECRET!, }, }, }), ], // collections, editor, secret… }) - 02
Create the VM and database
A Performance VM gives Next.js builds and Postgres room to breathe on the same box.
shell$ edge compute create --name site --size s-4vcpu-8gb \ --image ubuntu-24 --region london --script nodejs $ edge storage create acme-uploads $ edge compute ssh vm-6f2d90 $ apt install -y postgresql $ sudo -u postgres createdb acme - 03
Build, migrate and start
Run migrations before each start so the schema in code and the database never disagree.
shell$ rsync -a --exclude node_modules ./ root@<vm-ip>:/srv/site/ $ ssh root@<vm-ip> $ cd /srv/site && pnpm install --frozen-lockfile $ pnpm payload migrate && pnpm build $ pm2 start pnpm --name site -- start - 04
Put the CDN in front
One domain for the app, one for uploads with image transforms switched on.
shell$ edge cdn create --name acme-site $ edge cdn domains add cdn-a1b2c3 \ --domain acme.dev --origin https://<vm-ip> $ edge cdn domains add cdn-a1b2c3 \ --domain media.acme.dev --jit-image \ --origin-type storage --storage-bucket acme-uploads - 05
Query with the Local API
Same process, same VM: server components read straight from the database with no HTTP hop.
app/(frontend)/page.tsximport { getPayload } from 'payload' import config from '@payload-config' export default async function Page() { const payload = await getPayload({ config }) const posts = await payload.find({ collection: 'posts' }) return <PostList posts={posts.docs} /> }
Prefer to hand it off? Give the job to your AI agent or have our engineers do it.
What it costs
CMS and front end on one bill line
- No per-seat or per-document fees
- No function invocations to meter
- Upload delivery at $0 egress
- Hourly billing with optional hard caps
Estimated monthly bill on Edge
Payload + Next.js on one VM · ~5.5M requests/mo · 25 GB of uploads
- Compute$38.47Performance VM · 4 vCPU · 8 GiB · Payload, Next.js + Postgres
- CDN$1.255.5M requests: 500k free, then 5M × $0.25 per million
- Storage$0.3025 GB of uploads: 5 GB free, then 20 GB × $0.015
- DNS$0.00Apex, www and preview records
- Egress$0.00
FAQ
Payload on Edge, answered
Embedded in Next.js or standalone?
MongoDB or Postgres?
How does this compare to managed Payload hosting?
Can I deploy with Docker?
Does next/image work with Payload uploads?
Drop-in services
Add these without touching the stack
- Edge ShieldBot protection
POST /siteverify → score: 94Validate form submissions in a Payload beforeChange hook with one server-side call. No CAPTCHA widget.
Free for most sites. No puzzles, no widget to style.Explore - Edge AssistAI answers
<script src="…/assist.js">Add the widget to your Next.js front end for answers grounded in your published content.
Free tier: 250 answered questions a monthExplore
Ship Payload on Edge
Start free. Pair it with our Next.js guide for the full TypeScript story.
Free tiers hard-cap. Nothing bills until you add a card.