Skip to main content

By Denys Kravchenko

Drupal headless architecture

Drupal headless means the content stays in Drupal and a separate front end shows it. This post is the architecture. It covers what stays in the CMS, what moves to Next.js, why that helps a publisher, and where I host each side.

I already wrote why I choose this split, and when I would not, in Why I build headless Drupal. That one is the opinion. This one is the architecture.

The production example I can name is El Brujo Online. I built that site as a headless Drupal 11 CMS with a Next.js, React and TypeScript front end, and JSON:API as the pipe.1 Three Next.js apps share that one Drupal codebase, like a multisite. El Brujo did not use Drupal Canvas.

When I still recommend a normal Drupal theme

For a publishing site I still recommend a normal Drupal theme when there is only one website and the editors already work in Drupal's theme layer. If the team needs in-place preview and layout tools on that one site, a Twig theme with Layout Builder, or Drupal Canvas on a coupled Drupal site, is simpler than a second app.

I would also stay traditional when the team cannot own a separate front-end app, when the project must stay on one hosting stack, or when there is no second consumer in sight.2 A small newsroom that publishes to one domain, and that already has a theme its editors know, does not gain enough from the split to justify tokens, CORS, preview wiring and two deployments.

Headless pays off when the same content has to leave one website. A second brochure site, a later app, or another client that only wants the data. If that need is not there, I would rather ship one Drupal site.

What stays in Drupal and what moves to Next.js

In the setup I use, Drupal keeps the content model and the editorial work. Content types, fields, media, taxonomy, revisions, roles and workflows stay in Drupal. Menus stay in Drupal as well, so editors can change links without a front-end release. Next.js reads that menu data and renders it.

JSON:API ships in Drupal core. Turn it on and each content type, field and relationship can be an endpoint, with filtering, sorting and pagination already there. The JSON:API module documents that contract. That is the contract the front end codes against. The content stays structured data. The page is one way to show it.

Next.js keeps the routes, the page templates, the visual components, and the cache for each route. A path on the site points at a Drupal node. The front end can ship on its own. Designers are not waiting on a theme rebuild for every layout change.

Pickup bookingEditorsDrupalNext.js website 1Next.js website 2Next.js website 3Publish in DrupalJSON:APIJSON:APIJSON:API

Preview does not come free in this split. Drupal still stores the draft. The public Next.js app has to be told when an editor may see that draft. Search can stay close to the content, with a Drupal index exposed through the API, or it can live in the front end. I would keep an editor's search in Drupal. Public search on the Next.js site is a separate choice. I have not published how search works on El Brujo, so I will not name a product for it.

Pickup bookingEditorNextDrupalOpen the preview linkAsk for the draftUnpublished contentShow the draft page

Main benefits for media and publishing

Here is what I have actually seen on a publishing site.

On El Brujo Online, one Drupal 11 site feeds three Next.js apps. It works like a multisite. One CMS, three front ends. Editors work in that one Drupal site. Each app can look different, and the content is not copied into a second CMS. The content is multilingual, and it is managed in one place. Reusable templates and components made new pages quicker to assemble and easier to keep consistent.

That is the benefit I will stand behind for media and publishing. A newsroom or a publisher with more than one site, more than one language, or a later app in mind, can use the same pattern.

El Brujo did not use Drupal Canvas. The same Drupal site is the CMS for three Next.js apps.

The limits belong in the same picture. You now have two applications. Auth and draft preview are wiring you add. You need people who can work in PHP and in TypeScript. A cache that stays warm after an editor hits save, a front end that cannot see unpublished content, and a browser calling the API from the wrong origin are all real problems. They pay off when a second consumer shows up. They do not pay off because React is fashionable.

Headless Drupal hosting for developers

Hosting is two places, not one. Drupal runs in one place. The Next.js apps run in another. Each side has its own deploy.

In my setup, Drupal is hosted on Pantheon. A developer deploys the Drupal code there. That means core, modules, themes and configuration, committed in Git. Pantheon gives each site Dev, Test and Live environments. Code is writable in Dev. You deploy that code up to Test and then to Live. The database and uploaded files are cloned down from Live when you want a fresh copy to test against. You do not normally overwrite a live database with a development one.3

Hetzner is a cheaper option for Drupal. On Hetzner's managed web hosting you install the PHP site yourself, set the document root to Drupal's web directory, and adjust PHP to what Drupal needs. Hetzner documents installing Drupal on managed hosting and PHP configuration. On Hetzner Cloud you also run the server. A developer still deploys the Drupal code, but owns updates, the database, HTTPS and backups directly, instead of using Pantheon's Dev, Test and Live workflow.

The Next.js part runs on Vercel. A developer deploys the Next.js app, not the Drupal codebase. The usual path is to connect a Git repository. Each commit or pull request can build a preview URL. Production is a separate deploy to the live domain.4 Environment variables on Vercel hold the Drupal API URL, the preview secret and anything else the app should not store in Git. This is my current practice. I am not saying El Brujo itself runs on these hosts.

SideWhere it runsWhat a developer deploys
DrupalPantheon, or Hetzner as a cheaper option Drupal code in Git. Core, modules, themes and config. Database and files stay on the host.
Next.jsVercel The Next.js app, plus environment variables for the API and preview.

An editor still publishes in Drupal. A visitor still hits the Next.js site. Clearing or rebuilding the front-end cache is part of a Drupal publish, not a side effect you can assume.

How an editor previews a page before it is public

On a coupled Drupal site, preview is built in. The theme, or Drupal Canvas if you use it on that site, can show the page before it is public.

On a headless Next.js site, that built-in preview does not reach the visitor-facing app on its own. Next.js Draft Mode is the usual way to fill the gap. The CMS opens a preview URL on the Next.js app. That route checks a shared secret, sets a cookie and shows the draft. While Draft Mode is on, Next.js skips its cached HTML and fetches fresh content. Other visitors still see the published page. Next.js documents Draft Mode, and next-drupal documents the Drupal routes. I am not claiming El Brujo uses that package.

El Brujo is that kind of split. Preview there is a Next.js concern wired back to Drupal. It is not Drupal Canvas. I have not published the exact preview wiring used on that project, so I will not invent those details here.

If you use Canvas Headless with a separate Next.js app, you can have both. The official Canvas docs say the Canvas editor can embed the app so editors preview their work, draft content included, rendered by the app itself. The Canvas headless docs describe that embed.

Drupal Canvas components, from YAML and Twig to a Next.js app

Drupal Canvas is Drupal's visual page builder. It is a stable module for Drupal 11.3 and newer. The current official release at the time of writing is 1.12.0, published on September 25, 2026.5 It was first developed under the name Experience Builder. What follows is how the component model fits a publishing site. It is not a description of El Brujo. I wrote the longer version on Echo Flow, Stop patching Drupal. Switch to Canvas.

There are three component approaches worth keeping straight.

Single Directory Components, often called SDC, are Drupal core components. Each one lives in a folder with a YAML file and a Twig template, and it may also have CSS or JavaScript. Drupal's SDC guide shows the folder. The YAML lists the component's props and slots. Props are the editable fields, such as a heading, body text and an image. A slot is a place where an editor can drop other components, such as buttons under the text.

Code components are React-style components written in JavaScript. You define the props and slots, preview the component, and add it to the library. The official Canvas docs also describe a local codebase and a CLI, for teams that want source control and their own editor. Canvas renders these components with Preact and a React compatibility layer. The code component docs describe that path.

Canvas Headless is the third path. The front end is a separate Next.js app. For the build we use, the Echo Flow guide Headless Drupal 11 with Next.js covers the Drupal backend, JSON:API, and a Next.js front end that can share one identity with a second app. The official docs describe a Headless SDK and a canvas_headless module. The editor can embed the Next.js app, register the app's components in Canvas, and preview draft pages as the app will render them. Official starters exist for Next.js and several other frameworks, and they include draft preview. The starters live in drupal-canvas/headless-templates.

Props and slots, and what an editor should change

Props are the fields on a component. Slots are the holes an editor can fill with other components.

A publishing editor should be able to change prop values. That is the heading, the image, the teaser text, or a choice such as alignment. They should also be able to place allowed components into slots.

The shape of those props and slots should stay in code. Developers define the schema in the SDC YAML, in the Canvas component data for a code component, or in the front-end component metadata for a headless app, as the component metadata describes. Editors should not have to rename slots or invent new props to finish a page. If a new field is needed, that is a small developer change, then a new version of the component.

What breaks when the front end and Drupal are deployed separately

The interesting bugs live on the seam. I plan for these before I plan for a new component.

  • Cache. The Next.js app will keep serving a cached page after an editor hits save, unless Drupal tells it which path or cache tag to drop. Revalidation has to be part of publish, not an afterthought.
  • Images. Drupal stores files on the CMS host. The front end has to be allowed to request those image URLs, and a Next.js image loader has to be told which remote hosts are safe. Image styles, stale media and mixed CMS and front-end domains are common sources of broken pictures.
  • Auth. Published JSON:API traffic and draft traffic are not the same. A front end that uses an anonymous API will not see unpublished content. Draft preview needs a trusted route, a secret or token, and care with CORS so the browser is not allowed to call the API from the wrong origin.
  • Draft preview. If the preview secret, the slug, or the unpublished API access is wrong, the editor will see a 404, an empty page, or the old published version. That failure is easy to miss if you only test as an anonymous visitor.

The smallest first milestone

After someone reads this, I would not start with a full migration. The smallest useful piece of work is a headless proof page. One content type in Drupal, one Next.js page that renders it, and a working draft preview. That is enough to test hosting, the API, cache and preview before you commit to more pages.

If the team wants to stay on a normal Drupal theme and try Canvas, a single SDC or a small code component is a better first step than going headless. If the site is still on an older Drupal version, a short migration outline comes first, so you know whether Drupal 11 is even ready for this split.

Frequently asked questions

What is Drupal headless architecture?

It is the split in which Drupal keeps the content, roles and editorial workflow, and a separate front end such as Next.js renders the public pages. JSON:API is the usual pipe between the two.

What is Drupal headless?

Drupal headless means you keep content in Drupal and show it through a separate front end, instead of a normal Drupal theme. Use it when the same content has to reach more than one site or app. If it does not, a normal Drupal theme is usually enough.

What are the main benefits for media and publishing?

On El Brujo, one Drupal site feeds three Next.js apps. Editors stay in one CMS, the content stays multilingual in one place, and each app can look different. You still host two kinds of application, and you still wire cache, images, auth and draft preview.

What should developers know about headless Drupal hosting?

Drupal and the Next.js app run in different places and are deployed separately. In my setup, Drupal is hosted on Pantheon, Hetzner is a cheaper option for Drupal, and the Next.js part runs on Vercel. A developer deploys Drupal code on the CMS host, and the Next.js app plus its environment variables on Vercel.

Want to talk through whether this fits a publishing site?

Written by Denys Kravchenko. Last updated .

Footnotes and references

  1. El Brujo Online case study. The published stack is Drupal 11, JSON:API, Next.js, React and TypeScript. Three Next.js apps share that one Drupal site. El Brujo Online and elbrujo.online. The case study does not mention Drupal Canvas. ↩

  2. When I would not go headless. Why I build headless Drupal. ↩

  3. Pantheon, Pantheon WebOps Workflow. Code moves from Dev to Test to Live. Database and files are cloned down from Live. ↩

  4. Vercel, Deploying to Vercel. ↩

  5. Drupal Canvas 1.12.0, released September 25, 2026, for Drupal 11.3 and newer. Release notes. ↩