Skip to content

Full-stack frameworks

Deploy a Nuxt app on Enzonic

Deploy builds Nuxt with the Nitro node-server preset and runs .output/server/index.mjs, so server routes, server-side rendering and runtime config work as in nuxt preview. A build script that runs nuxt generate produces a static site instead.

At a glance

What Enzonic Deploy does with a Nuxt project when you connect it. You can override any of it in the project settings.

Language
JavaScript / TypeScript
Detected from
nuxt in dependencies or devDependencies; A build script containing "generate" switches to static mode
Build command
nuxt build (or your build script)
Output
.output (server) or .output/public (static)
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 NITRO_PRESET=node-server for the build and starts .output/server/index.mjs.

  • Static

    When the build script runs nuxt generate. Only .output/public is served.

Deploy Nuxt step by step

  1. 1Connect the repository on deploy.enzonic.com; Nuxt is detected from package.json.
  2. 2Set NUXT_ prefixed variables for runtime config in the project's environment variables.
  3. 3Deploy. Previews get their own URL per branch, production follows the default branch.
package.json
{
  "scripts": {
    "build": "nuxt build",
    "generate": "nuxt generate",
    "dev": "nuxt dev"
  }
}
Keep "build": "nuxt build" for a server. Point "build" at nuxt generate only if you want a static site.

Connect a database to Nuxt

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.

server/api/posts.get.ts
import pg from 'pg';

const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL });

export default defineEventHandler(async () => {
  const { rows } = await pool.query('select id, title from posts order by id desc limit 20');
  return rows;
});

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 engine

Things to know

  • A nitro preset set in nuxt.config to something other than node-server (for example a serverless provider preset) wins over the environment and produces output Deploy cannot run.
  • Variables that must reach the browser go under runtimeConfig.public and need the NUXT_PUBLIC_ prefix.

Plan limits that matter here

From the live plan data. Every plan includes previews for each branch, instant rollback, environment variables and logs.

Plan limits that matter for Nuxt
LimitFreePro
Build minutes3,000/mo, 1 concurrent10,000/mo, 3 concurrent
Servers1 instance, 512 MB, sleeps after 15 min idle3 always-on, 2 GB
Bandwidth150 GB/mo2 TB/mo

Compare every plan

Related guides

Ship your Nuxt project tonight

Connect the repository and the build settings fill themselves in. Free plan, no card.

Start free