Skip to content

Deploy a Next.js app

  1. Push your Next.js app to GitHub.
  2. In the console, start a new app, pick the repository and click Deploy with Drone.
  3. Add your environment variables and click Deploy.

Or, from the project folder: hivepod deploy.

Pick Next.js under Choose Framework. DockHive installs your dependencies, runs next build and serves the app with next start (or the standalone server if you set output: 'standalone' in next.config.js).

Make sure package.json has the usual scripts:

package.json
{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
}
}

next start listens on the PORT variable DockHive sets, so no extra setup is needed.

  • Environment variables: server-side variables (read in API routes, server components and getServerSideProps) come from your app’s settings at runtime. NEXT_PUBLIC_* values are inlined at build time; see the note in Environment variables.
  • Monorepos: set Root Directory to the Next.js app’s folder, for example apps/web.