Skip to content

For Payload

Payload on Edge, inside your Next.js app

The TypeScript-first CMS runs in the same next start process as your site: a real VM, uploads in S3-compatible storage and pages cached in 988 locations. No cold starts, no edge-runtime limits.

Free to sign up. No egress fees on any product.

Why Payload on Edge

Payload runs here exactly as it runs on your laptop

A real VM means a long-lived Node process. No serverless cold starts, no edge-runtime restrictions, no function time-outs.
  • 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

Payload and Next.js share one process on one VM. The database sits beside it, uploads go to storage and the CDN handles the world.
  • 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

The Payload 3 website template, deployed as a normal Next.js app. Swap the rsync for CI once it works by hand.
  1. 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.ts
    import { 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…
    })
  2. 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
  3. 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
  4. 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
  5. 05

    Query with the Local API

    Same process, same VM: server components read straight from the database with no HTTP hop.

    app/(frontend)/page.tsx
    import { 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

Payload, Next.js and Postgres share one VM. Uploads sit in a bucket and the CDN takes the reads.
  • No per-seat or per-document fees
  • No function invocations to meter
  • Upload delivery at $0 egress
  • Hourly billing with optional hard caps
See compute pricing

Estimated monthly bill on Edge

Payload + Next.js on one VM · ~5.5M requests/mo · 25 GB of uploads

USD
  • 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
Total$40.02

FAQ

Payload on Edge, answered

Something else? Ask an engineer.
Embedded in Next.js or standalone?
Either. Embedded means one VM serves the admin at /admin and your front end. Standalone puts the CMS API and the front end on separate VMs, which helps when they scale differently or several apps share one CMS.
MongoDB or Postgres?
Postgres suits relational schemas and teams that already run it. MongoDB suits document-heavy content with flexible fields. Payload supports both; pick what your team knows.
How does this compare to managed Payload hosting?
Same open-source software, but you control the host. You get a predictable bill, custom plugins and Payload sitting next to the rest of your infrastructure.
Can I deploy with Docker?
Yes. Payload runs cleanly in a container; see the Docker stack for the pattern. Plain Node with PM2 or systemd is leaner if you don't need it.
Does next/image work with Payload uploads?
Yes. Point next/image at the CDN with a custom loader, as on our Next.js page. You get resizing and AVIF or WebP from the upload URL with no per-image fees.

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.