Skip to main content

Vercel

Vercel is supported for the Next.js UI app only. Deploy apps/ui to Vercel and run Strapi somewhere else, such as Heroku or Strapi Cloud.

Strapi is not supported on Vercel

Do not deploy apps/strapi to Vercel. Strapi needs a long-running Node.js server, persistent database access, writable/runtime storage decisions, and admin/API behavior that does not fit Vercel's serverless frontend deployment model for this starter.

App Layout

AppVercel supportNotes
apps/uiYesNext.js App Router frontend.
apps/strapiNoHost Strapi separately and point the UI to it with STRAPI_URL.
apps/docsOptionalUsually deployed through GitHub Pages in this starter.

Create The Vercel Project

Create a new Vercel project from the repository and configure it for the UI workspace:

SettingValue
Framework presetNext.js
Root directoryapps/ui
Install commandpnpm install --frozen-lockfile
Build commandpnpm build
Output directoryLeave default for Next.js
Monorepo root

Even though the Vercel project root directory is apps/ui, Vercel still detects the repository and lockfile. Keep pnpm-lock.yaml committed at the monorepo root.

Environment Variables

Configure required UI environment variables in Vercel Project Settings. Start from apps/ui/.env.local.example and the UI Environment Variables reference.

Minimum production-like setup:

VariablePurpose
APP_PUBLIC_URLPublic URL of the Vercel UI app.
STRAPI_URLServer-reachable URL of the separately hosted Strapi app.
STRAPI_REST_READONLY_API_KEYRead-only Strapi API token for public content reads.
STRAPI_REST_CUSTOM_API_KEYRequired only when browser-safe proxy writes are used.
BETTER_AUTH_SECRETRequired when end-user auth is enabled.
STRAPI_PREVIEW_SECRETRequired when Strapi preview is enabled. Must match Strapi.
APP_ENVDeployment label such as testing or production.

Strapi URL

STRAPI_URL must point to the backend that Vercel can reach from server-side code. For example:

STRAPI_URL=https://your-strapi-app.herokuapp.com

The browser should not need direct access to private Strapi tokens. Client-side requests that need Strapi data should use the UI proxy routes documented in the UI section.

Preview and callbacks

If you use Strapi preview, password reset links, OAuth callbacks, or emails generated by Strapi, configure the matching frontend URL on the Strapi side as well. For Strapi this is usually CLIENT_URL.

Next.js Output Mode

Do not set NEXT_OUTPUT=standalone for Vercel. Vercel handles the Next.js build and runtime packaging.

For most Vercel deployments, leave NEXT_OUTPUT unset. Use NEXT_OUTPUT=export only when the project intentionally deploys a fully static export and accepts the tradeoffs documented in Caching.

Deployment Flow

  1. Deploy Strapi to a supported backend host.
  2. Configure Strapi database, upload provider, CORS, preview, auth providers, and CLIENT_URL.
  3. Create the Vercel project for apps/ui.
  4. Add UI environment variables in Vercel.
  5. Deploy the Vercel project.
  6. Verify that server-side UI requests can reach STRAPI_URL.
  7. Run the QA workflow against the Vercel deployment URL.