Best Headless CMS for Next.js: Payload, Strapi, Sanity, Contentful, Directus

A sourced comparison of five headless CMSs for Next.js: hosting, licence, content modelling, editor experience, and which one to pick when.

By Dmytro AntonyukPublished 9 min read

#headless-cms#nextjs#payload#strapi#sanity#contentful#directus

There is no single best headless CMS for Next.js, only the one that fits your team. Short version: pick Payload if you want a code-first, TypeScript CMS that lives inside your Next.js app; Strapi for a classic self-hosted CMS with an admin panel for editors; Sanity for structured content in a managed store with a customisable editing studio; Contentful for a fully managed SaaS platform; and Directus if you already have a SQL database and want an API and admin app on top of it.

The rest of this guide shows where those recommendations come from. Every claim links to the vendor's own docs or repository, accessed on 2026-11-13. Pricing is left out on purpose: it changes often, so check each vendor's pricing page before you decide.

If you are new to the idea, start with what a headless CMS is.

Comparison table

PayloadStrapiSanityContentfulDirectus
Hosting modelSelf-hosted, inside your Next.js appSelf-hosted or Strapi CloudContent in Sanity's hosted Content Lake; Studio self-deployed or hostedSaaSSelf-hosted (Docker) or Directus Cloud
Source codeOpen source, MITCommunity Edition MIT, ee/ code under a separate licenceStudio open source, MIT; Content Lake is a hosted serviceProprietarySource-available, MSCL 1.0
Content modellingTypeScript config in your repoContent-type Builder in the admin panelSchemas in Studio config (JS or TS)In the web appYour SQL schema
Query APIsREST, GraphQL, Node.js APIsREST, GraphQLGROQ, GraphQLDelivery and Preview APIsREST, GraphQL, SDK
DatabaseMongoDB or Postgres(not covered here)Managed by SanityManaged by ContentfulPostgres, MySQL, MariaDB, MS SQL, SQLite, OracleDB, CockroachDB and more

Sources for each cell are in the sections below.

Payload

Payload's docs call it "the Next.js fullstack framework". From one config you get an admin panel, a database with migrations, REST and GraphQL APIs, authentication, access control, file storage and live preview. The same page describes "straight-to-DB Node.js APIs generated from your config" and lists MongoDB and Postgres.

Hosting and Next.js fit: Payload "installs directly in your Next.js /app folder". Your site goes in its own route group next to it, and you wrap your Next.js config with withPayload. The docs say you can "deploy anywhere". In practice this means one repository and one deployment for the site and the CMS.

Licence: The Payload GitHub repository is MIT licensed, and the docs describe it as "one open-source TypeScript codebase you own".

Content modelling: Collections and fields are defined in TypeScript, in your repo. Content types go through code review and version control like the rest of the app.

Editor experience: The admin panel is an auto-generated React UI that "matches the shape of your data and extends with your own components" (Payload docs).

Pick it when your team writes TypeScript, already uses Next.js, and wants the CMS in the same codebase with no separate SaaS account.

Strapi

Strapi's docs describe it as an open-source headless CMS. Developers pick their own tools and frameworks, and editors manage content through the admin panel. Content is available over REST and GraphQL.

Hosting: Strapi can be self-hosted, and there is also Strapi Cloud, which has its own section in the docs.

Licence: The Strapi repository licence says the Community Edition is under the MIT Expat licence. Code under ee/ directories is the Enterprise Edition and uses a separate licence.

Paid features: Per the docs, Content History and Releases are available in the Growth and Enterprise plans. Audit Logs and Review Workflows require an Enterprise plan. If editorial workflow matters to you, check these before you commit.

Content modelling: The admin panel has two main parts: the Content Manager for entries and the Content-type Builder for defining content types.

Editor experience: Editors and developers share one admin panel: editors live in the Content Manager, developers shape types in the Content-type Builder.

Pick it when you want a self-hosted CMS with an admin panel for editors, run it as its own service next to your Next.js app, and are fine with some workflow features being paid.

Sanity

Sanity splits into two parts. Content lives in the Content Lake, which "stores your content as structured data" (Sanity docs). Editors work in Sanity Studio.

Hosting: The Sanity repository README says Sanity "hosts your content in a real-time, hosted data store called Content Lake". The Studio docs cover deploying Studio "either on your own or using our hosted service".

Licence: Sanity Studio is open source under MIT (GitHub). The Content Lake is Sanity's hosted service, so your content lives with Sanity.

Querying: Sanity has its own query language, GROQ, which lets you specify exactly the data an application needs. There is also a GraphQL API you can deploy, and a Live Content API for real-time delivery (Content Lake docs).

Content modelling and editor experience: The Studio is "an open-source, real-time collaborative content workbench", configured with JavaScript or TypeScript and customised through a React-based framework (Studio docs).

Pick it when you want a managed content store with no database to run, strongly structured content, and an editing UI your developers can shape in code.

Contentful

Contentful is a proprietary SaaS platform. In its comparison of headless and traditional CMSs, content is published to a CDN and delivered through APIs.

APIs: The official contentful.js SDK reads content through the Content Delivery API and the Content Preview API. The Preview API uses its own access token, which maps neatly to Next.js Draft Mode for showing drafts.

Hosting and licence: Fully managed. There is nothing to self-host and no open-source core. That means less operations work, and also that your content and content model sit on Contentful's platform.

Editor experience: The SDK README describes a "customizable web app" for developers and content creators, alongside the management and delivery APIs.

Pick it when your organisation wants a managed platform with no servers to run and is comfortable with a proprietary vendor.

Directus

Directus's docs call it "a backend for building your projects". You connect it to your database and get a REST and GraphQL API, an SDK, realtime, auth, file management and automations. Editors and the rest of the team use the Data Studio web app for content, files, users and dashboards.

Database: The Directus README says it "wraps any SQL database" and lists Postgres, MySQL, MariaDB, MS SQL, SQLite, OracleDB and CockroachDB. The APIs are generated from your database schema.

Hosting: Directus Cloud is a fully managed service, or you can self-host with Docker.

Licence: Directus uses the Monospace Sustainable Core License (MSCL) 1.0, which the README calls a source-available licence derived from the Fair Core License. A free core tier is available without a commercial licence. Organisations above the thresholds that use advanced or enterprise features need a commercial licence. Read the licence terms before you rely on it for a business.

Content modelling: Your SQL schema is the content model. Changes in the database show up in the API.

Pick it when you already have a SQL database (or want SQL to be the source of truth) and need an API and admin app on top of it.

Which headless CMS should you pick for Next.js?

Start from your constraints, not from feature lists:

  1. Do you want to run servers? If not, look at Sanity or Contentful. If yes, or you need full control over data, Payload, Strapi and Directus are self-hostable.
  2. Where should the content model live? In TypeScript code: Payload. In an admin UI: Strapi. In Studio config: Sanity. In the database: Directus.
  3. Is open source a requirement? Payload and Strapi Community Edition are MIT. Sanity Studio is MIT but the content store is hosted. Directus is source-available. Contentful is proprietary.
  4. Do you already have data? An existing SQL database points to Directus.
  5. How much do editors need? If review workflows, content history or releases matter, compare what each tool includes and on which plan.

For a typical Next.js team building a content site with TypeScript, Payload is the shortest path because it runs inside the same app. That is a fit judgement, not a ranking: a team that wants zero infrastructure will be happier with a SaaS option.

FAQ

What is the best open source headless CMS?

Among these five, Payload and Strapi (Community Edition) are MIT licensed. Sanity Studio is MIT, but content is stored in Sanity's hosted Content Lake. Directus is source-available under MSCL, not a classic open-source licence.

Which headless CMS works best with Next.js?

All five can feed a Next.js app over an API. Payload is the only one here that installs into the Next.js /app folder itself, so the CMS and the site share one codebase.

Is Contentful better than Sanity?

They solve similar problems differently. Both are managed. Sanity's editing Studio is open source and customised in code, and you query with GROQ or GraphQL. Contentful is fully proprietary and delivers content through its Delivery and Preview APIs. Pick based on how much you want to customise the editor and on pricing at your scale.

Can I self-host Strapi and Directus?

Yes. Strapi has self-hosted and Cloud options, and Directus can be self-hosted with Docker or used as Directus Cloud.

Do I need GraphQL to use a headless CMS?

No. Payload, Strapi and Directus all offer REST as well as GraphQL. Sanity has GROQ, and Contentful has its REST delivery APIs.

Build the skills under the CMS

A headless CMS is mostly APIs, data modelling and a Node.js runtime. ShortLesson has short practical courses on each: HTTP and REST APIs, Node.js: the basics, GraphQL: the basics, SQL and PostgreSQL and TypeScript Essentials.

Follow the author

Dmytro Antonyuk · Author

New articles and notes on learning and frontend.

Practice interview questions

The app has questions junior developers often get in interviews. Answer them, read the feedback, and come back to your weak spots.

The app is coming to the stores soon.

← All articles