Framework

Next.js

Next.js App Router or Pages Router, with optional Prisma integration.

Container port3000

Requirements

next.config.js / .ts / .mjs in the root

This file is how DropDeploy identifies your project as Next.js.

"build" and "start" scripts in package.json

"build": "next build" and "start": "next start" must both be present.

Demo app

A minimal app that is ready to push and deploy. Copy the files below into a new repository, commit, and deploy — it should go live without any changes.

Quickstart

npx create-next-app@latest my-next-app
next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {};
module.exports = nextConfig;
package.json
{
  "name": "my-next-app",
  "version": "1.0.0",
  "scripts": {
    "dev":   "next dev",
    "build": "next build",
    "start": "next start"
  },
  "dependencies": {
    "next":      "^15.0.0",
    "react":     "^18.0.0",
    "react-dom": "^18.0.0"
  }
}
app/page.tsx
export default function Home() {
  return (
    <main style={{
      display: 'flex', justifyContent: 'center', alignItems: 'center',
      minHeight: '100vh', fontFamily: 'system-ui',
      background: '#0f172a', color: '#f1f5f9',
    }}>
      <div style={{ textAlign: 'center' }}>
        <h1 style={{ color: '#3b82f6' }}>Hello from DropDeploy!</h1>
        <p style={{ color: '#94a3b8' }}>Next.js app is live.</p>
      </div>
    </main>
  );
}
app/layout.tsx
export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}
The quickstart command is the fastest path. The files above show the minimum required structure if you are building from scratch.

Build & start commands

DropDeploy runs these steps inside the container when you click Deploy.

npm install
# if prisma/schema.prisma exists:
npx prisma generate
npm run build
npm start

Environment variables

Set these in Project → Env Vars in the dashboard. Never commit secrets.

VariableRequiredDescription
DATABASE_URLNoRuntime database connection string. Required if your app queries a DB.
NEXT_PUBLIC_*NoBaked into the client bundle at build time. Add them in the dashboard before deploying.
NEXTAUTH_SECRETNoRequired if using NextAuth.
NEXTAUTH_URLNoSet to your full DropDeploy subdomain URL.

Common issues

NEXT_PUBLIC_ vars are empty

These are baked in at build time. Add them to the dashboard env vars before you click Deploy.

Prisma "PrismaClient did not initialize"

Set DATABASE_URL as a runtime env var. The placeholder value used during the build is not a real connection.

output: "export" is not supported

DropDeploy runs next start which requires a server. Remove output: "export" from next.config, or use the React framework type for fully static output.