Cloudflare

Payload on Workers: a full-fledged CMS, running entirely on Cloudflare’s stack

Sep 30, 2025Jason Kincaid, Ricardo Tavares
Payload on Workers: a full-fledged CMS, running entirely on Cloudflare’s stack
SummaryAI, from the source post

This post details the technical implementation of deploying Payload CMS, a Node.js/Express.js and Next.js application, entirely on Cloudflare's Developer Platform. It covers the creation of custom adapters for Cloudflare D1 (SQLite-based managed database) and R2 (object storage) to integrate with Payload's existing database and storage mechanisms. Key technical contributions include: a custom D1 adapter that maps D1 results to the format expected by libSQL/Drizzle ORM, enabling database migrations via Wrangler remote bindings; a custom R2 storage adapter that leverages the R2 binding for uploads and downloads, addressing Miniflare compatibility issues; and the use of Hyperdrive to front an external Postgres database for connection pooling and query caching. It also discusses performance optimizations for D1 using read replicas with the 'first-primary' session type and the serverless benefits of running a CMS on Cloudflare Workers.

More from the Content Management System (CMS) Evolution trail