Full-stack frameworks
Deploy a Next.js app on Enzonic
Enzonic Deploy builds a Next.js app from your repository and runs it as a Node.js server with server components, route handlers, middleware and image optimization working as they do locally. If next.config sets output: 'export', the same project deploys as a static site instead.
At a glance
What Enzonic Deploy does with a Next.js project when you connect it. You can override any of it in the project settings.
- Language
- JavaScript / TypeScript
- Detected from
- next in dependencies or devDependencies; next.config.js, .mjs, .ts, .cjs or .mts (read to spot output: 'export'); Your lockfile, to pick npm, pnpm, Yarn or Bun
- Build command
- next build (or your build script)
- Output
- .next (server) or out (static export)
- Runs as
- Server or Static
Dependencies install with the package manager your lockfile names: npm ci, pnpm install --frozen-lockfile, yarn install --immutable (Berry) or --frozen-lockfile, or bun install --frozen-lockfile. Node.js 18, 20, 22 and 24 are available. Deploy reads engines.node in package.json, then .nvmrc or .node-version, and uses Node.js 22 when nothing pins a version.
How it runs
Server
The default. Deploy sets NEXT_PRIVATE_STANDALONE=true for the build, so Next.js writes .next/standalone, and runs its server.js.
Static
When next.config sets output: 'export'. The out folder is served from the edge with no server at all.
Deploy Next.js step by step
- 1Push the repository to GitHub, or upload a folder from the CLI or the API.
- 2Create a project on deploy.enzonic.com and pick the repository. The framework, build command and output directory fill themselves in.
- 3Add environment variables for production, preview and development if the app needs them. Variables used in the browser keep the NEXT_PUBLIC_ prefix.
- 4Deploy. Every later push to the production branch goes live, and every other branch gets its own preview URL.
/** Optional: only for a fully static site. Leave output unset to run as a server. */
const nextConfig = {
output: 'export',
images: { unoptimized: true },
};
export default nextConfig;Connect a database to Next.js
Create a database on Enzonic Databases (or from the project's settings) and its connection string is added to the project's environment variables. This example uses PostgreSQL.
import postgres from 'postgres';
const sql = postgres(process.env.DATABASE_URL!);
export async function GET() {
const [{ now }] = await sql`select now()`;
return Response.json({ now });
}Postgres projects get two variables: DATABASE_URL through the connection pooler for the app, and DATABASE_URL_UNPOOLED for migrations.
PostgreSQL on Enzonic DatabasesEvery database engineThings to know
- A custom output in next.config (anything other than unset, standalone or export) leaves Deploy without .next/standalone or out, and the build stops with a clear message.
- next start is not used: the standalone server.js is. Code that depends on files outside the traced output should read them at build time.
- On the Free plan a server project sleeps after 15 minutes without requests and wakes on the next one; paid plans keep servers always on.
Plan limits that matter here
From the live plan data. Every plan includes previews for each branch, instant rollback, environment variables and logs.
| Limit | Free | Pro |
|---|---|---|
| Build minutes | 3,000/mo, 1 concurrent | 10,000/mo, 3 concurrent |
| Servers | 1 instance, 512 MB, sleeps after 15 min idle | 3 always-on, 2 GB |
| Bandwidth | 150 GB/mo | 2 TB/mo |
Related guides
- Deploy a Remix appRemix v2 (Vite or classic compiler) served with remix-serve.
- Deploy a Nuxt appNuxt 3 and 4 on the Nitro node-server preset, or a generated static site.
- Deploy a SvelteKit appSvelteKit with adapter-node as a server, or adapter-static as a static site.
Ship your Next.js project tonight
Connect the repository and the build settings fill themselves in. Free plan, no card.