DeployxaDocs Portal
CLI v1.0.4
Deploy Nuxt App (Vue 3 Nitro)
Framework guide · Nuxt

Deploy a Nuxt app (Vue 3, Nitro)

Nuxt builds a self-contained Nitro server into .output/. On Deployxa it runs as a Node.js server, so SSR, server routes under server/api and hybrid route rules all work. Fully static sites can be generated instead.

Prerequisites

  • A Nuxt 3 or newer project (as created by npm create nuxt@latest) with a committed lockfile.
  • The standard scripts: "build": "nuxt build" and "postinstall": "nuxt prepare".

How Deployxa detects Nuxt

A nuxt dependency selects the Nuxt preset on Node.js 20.

SettingValue
Build commandnpm run build
Output directory.output
Start commandnpm start; set it to node .output/server/index.mjs
Port3000

Required config: a start command

Projects generated by create nuxt have no start script. Add one that runs the built Nitro server, or set the service's start command to the same thing:

json
{
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare",
    "start": "node .output/server/index.mjs"
  }
}

The default Nitro preset (node-server) reads PORT (or NITRO_PORT) and HOST (or NITRO_HOST). Set HOST=0.0.0.0 and PORT=3000 as environment variables and Internal Port to 3000.

Static generation instead

If every page can be prerendered, run nuxt generate as the build command and serve .output/public as the output directory. No server process is needed, but server routes are not available.

Environment variables and runtime config

Declare config in nuxt.config.ts and override it at runtime with NUXT_-prefixed variables:

ts
// nuxt.config.ts
export default defineNuxtConfig({
  runtimeConfig: {
    databaseUrl: '',                 // NUXT_DATABASE_URL
    public: { apiBase: '/api' },     // NUXT_PUBLIC_API_BASE
  },
});

// server/api/hello.get.ts
export default defineEventHandler(() => {
  const config = useRuntimeConfig();
  return { apiBase: config.public.apiBase };
});
KeyPurposeExample
HOSTBind address for the Nitro server0.0.0.0
PORTListen port3000
NUXT_PUBLIC_API_BASEOverrides runtimeConfig.public.apiBasehttps://api.example.com
NUXT_DATABASE_URLOverrides runtimeConfig.databaseUrlpostgresql://…

Databases

In the wizard's Configure step, set Database to PostgreSQL. The connection string is injected into the app as DATABASE_URL, so nothing needs to be committed. Choose SQLite only for small apps: it lives on a persistent volume and has no server.

Read process.env.DATABASE_URL directly in server routes, or map it to runtime config by setting NUXT_DATABASE_URL to the same connection string. Keep database clients in server/ so they never reach the browser bundle.

Deploy

From the dashboard

  1. 1
    Source

    Open Dashboard → Projects → New project (/dashboard/projects/new). Pick the GitHub repository and branch, or upload a .zip archive of the project.

  2. 2
    Configure

    Leave the framework preset on Auto-detect or choose Nuxt. Check the fields under advanced settings:

    • Build command: npm run build
    • Output directory: .output
    • Root directory: ./, or the sub-folder that holds the app in a monorepo
  3. 3
    Environment

    Add your variables in the table, or paste a whole .env file into the Bulk / .env tab.

  4. 4
    Deploy

    Start the deploy and watch the build log. When the release passes its health check it is served over HTTPS on its Deployxa URL.

  5. 5
    Confirm the start command and port

    Open the project's Environment Canvas tab and select the web service. Set Start Command to node .output/server/index.mjs. Set Internal Port to 3000 so it matches the port your app listens on. Save and redeploy if you changed anything.

From the CLI

shell
$ npm install -g @deployxa/cli
$ deployxa login
$ cd my-app
$ deployxa link            # pick an existing project, or skip: deploy creates one
$ deployxa env set HOST 0.0.0.0
$ deployxa deploy
$ deployxa logs --live     # stream build and runtime logs
$ deployxa open            # open the live URL

If the folder is not linked, deployxa deploy creates a project named after the folder and links it (the link is saved in .deployxa/config.json). Later runs deploy the linked project. deployxa status shows the latest deployment and deployxa rollback previous returns to the release before it.

Warning: deployxa deploy packages the folder exactly as it is on disk; it does not read .gitignore. Delete local node_modules, virtualenvs, build output and real .env files first, or deploy from a clean clone. Set secrets with deployxa env set instead of shipping them in the archive.

Starting fresh? deployxa create nuxt scaffolds a minimal Nuxt starter you can deploy straight away.

Custom domain

Go to Dashboard → Domains, choose Connect a domain you already own and pick this project. Deployxa then shows the DNS records to create at your DNS provider:

RecordUse it forValue
AAn apex domain such as example.com85.17.244.184 (DNS only on Cloudflare)
CNAMEA subdomain such as www or appcname.deployxa.com (DNS only on Cloudflare)
TXTOnly when a CDN or proxy (for example Cloudflare orange-cloud) hides the origin recordHost _deployxa-challenge.<your-domain>, value deployxa-verification=…

DNS changes can take several minutes to propagate; use Retry verification once they have. A Let's Encrypt certificate is issued after the domain verifies. From a linked folder you can do the same with the CLI:

shell
$ deployxa domains add app.example.com
$ deployxa dns             # Waiting → Verified → SSL Active
$ deployxa domains list

Common errors and fixes

SymptomFix
Missing script: "start"Add "start": "node .output/server/index.mjs" or set the start command.
Health check fails; server listens on localhostSet HOST=0.0.0.0 (or NITRO_HOST).
Cannot find module .output/server/index.mjsThe build used a different Nitro preset. Remove a custom nitro.preset or set it to node-server.
Runtime config value not appliedThe variable name must match the key path: runtimeConfig.public.apiBase → NUXT_PUBLIC_API_BASE.
Hydration mismatch warningsCode that reads window, dates or random values during SSR; wrap it in <ClientOnly> or onMounted.

Start with deployxa logs --live (or the deployment's log view in the dashboard): the build log shows dependency and compile failures, the runtime log shows crashes and bind errors. See also Troubleshooting.