Deploy on Pantheon

Pantheon's Next.js hosting is currently in invite-only beta. You need beta access enabled on your Pantheon workspace before you can create Next.js sites.

Pantheon's Next.js Beta hosting supports deploying Next.js frontends with Lupus Decoupled Drupal. Since the platform uses a framework-agnostic Node.js build pipeline under the hood, Nuxt frontends also work.

Prerequisites

  • A Pantheon workspace with Next.js Beta access enabled
  • A Drupal site with lupus_decoupled installed and the custom elements API working
  • A GitHub account connected to your Pantheon workspace

Step 1: Create the frontend site on Pantheon

  1. Go to Pantheon Dashboard → Add SiteNext.js
  2. Choose "Create new repository"
Do not use "Connect existing repository" — it fails silently without any error message. Let Pantheon create the repo first, then push your code to it.
  1. Wait for the initial template deployment to succeed
  2. Note the GitHub repo that was created (e.g. your-org/your-site-name)

Step 2: Prepare your frontend

Clone a Lupus Decoupled frontend starter:

Nuxt
git clone https://github.com/drunomics/lupus-decoupled-nuxt-starter.git my-frontend
Next.js
git clone https://github.com/drunomics/lupus-decoupled-nextjs-example.git my-frontend

Configure it to point at your Pantheon Drupal backend. The recommended approach is to set the Drupal base URL as an environment variable on Pantheon via Dashboard → Settings → Environment Variables (only available after the first successful deployment):

Nuxt
NUXT_PUBLIC_DRUPAL_CE_DRUPAL_BASE_URL=https://dev-your-drupal-site.pantheonsite.io
Next.js
NEXT_PUBLIC_DRUPAL_BASE_URL=https://dev-your-drupal-site.pantheonsite.io

Alternatively, you can set the base URL directly in the framework config:

Nuxt — nuxt.config.ts
export default defineNuxtConfig({
  modules: ['nuxtjs-drupal-ce'],
  drupalCe: {
    drupalBaseUrl: 'https://dev-your-drupal-site.pantheonsite.io',
  },
})
Next.js — .env.local
NEXT_PUBLIC_DRUPAL_BASE_URL=https://dev-your-drupal-site.pantheonsite.io
For Nuxt, all nuxtjs-drupal-ce options can be overridden at runtime via NUXT_PUBLIC_DRUPAL_CE_* environment variables. See the nuxtjs-drupal-ce documentation for details.

Step 3: Push to Pantheon

Push your frontend code to the GitHub repo Pantheon created:

cd my-frontend
rm -rf .git
git init && git add -A && git commit -m "Initial deploy"
git remote add origin git@github.com:your-org/your-pantheon-repo.git
git branch -m main
git push --force origin main

Step 4: Wait for the build

Pantheon builds automatically on push. This typically takes 5–10 minutes.

You can check deployment status via the GitHub API:

gh api repos/your-org/your-repo/deployments --jq '.[0].statuses_url' | xargs gh api --jq '.[0].state'

Step 5: Verify

Visit https://dev-your-frontend-site.pantheonsite.io/. You may need to click through Pantheon's sandbox page on first visit. Your Drupal content should render through the frontend.

Node.js version

Pantheon auto-detects the Node.js version from the engines field in package.json. If not specified, it defaults to Node.js LTS (currently v22).

{
  "engines": {
    "node": ">=22"
  }
}