Deploy a bundle from anywhere

Deploy a Next.js app on pooled hosting from a build made on your own machine or in any CI, with no repository and no image, in one command or three API calls.

Last updated 30 November 2026View as Markdown

An app on pooled hosting is deployed from a bundle: what next build wrote, packed as a tar.gz. The starter template's workflow makes and uploads it on every push, but nothing ties a bundle to our CI: build wherever you like and hand the result over. The app needs no repository and no image. Replace app-id with the app's id or slug.

Prerequisites

  • An app with pooled hosting (hosting: pooled when you create it). An app on its own machines deploys from a repository or an image instead; see Deploy an app.
  • Permission for deploy:DeployApp on the app, and deploy:DescribeApp to look it up by its slug.
  • A Next.js project with output: 'standalone' in its next.config.

Build the app

From Next 16.2 on, the platform reads the build through Next's Adapters API: a small hook that writes .next/ews-outputs.json during next build and serves nothing. Save it as ews/next-export.cjs in your project:

// Writes Next's description of every build output to .next/ews-outputs.json.
// Loaded by Next with require() (NEXT_ADAPTER_PATH=<this file>), so it stays CommonJS.
const fs = require('node:fs');
const path = require('node:path');
module.exports = {
  name: 'ews-output-export',
  async onBuildComplete(ctx) {
    const out = {
      nextVersion: ctx.nextVersion,
      buildId: ctx.buildId,
      projectDir: ctx.projectDir,
      routing: ctx.routing,
      outputs: ctx.outputs,
      config: {
        basePath: ctx.config.basePath,
        i18n: ctx.config.i18n,
        trailingSlash: ctx.config.trailingSlash,
        images: ctx.config.images,
      },
    };
    fs.writeFileSync(
      path.join(ctx.distDir, 'ews-outputs.json'),
      JSON.stringify(out, (k, v) => (v instanceof Map ? Object.fromEntries(v) : v), 2),
    );
  },
};

Then build with the hook:

NEXT_ADAPTER_PATH=$PWD/ews/next-export.cjs npx next build

Next 15.x to 16.1 need no hook: the pool host reads their build manifests itself.

Deploy the build

Not available in Console. The console shows the deployments of a pooled app, but does not upload a bundle.

Complete is refused with 409 "The bundle has not been uploaded" before the upload, and with 409 "The bundle is … bytes, … were announced" when the uploaded size differs from sizeBytes. The pool host checks the SHA-256 again after download and does not serve a bundle that does not match.

Did this page help you?