---
title: "Installation"
description: "Install nuxt-backend into a Nuxt app you already have with one command, through a coding agent in one prompt, or by hand, with or without nuxt-convex-module."
canonical_url: "https://nuxt-backend.dev/docs/start/installation"
---
# Installation

> Install nuxt-backend into a Nuxt app you already have with one command, through a coding agent in one prompt, or by hand, with or without nuxt-convex-module.

Version: nuxt-backend 0.6.x · Tab: Start · Kind: how-to · Status: stable

Every page: [llms.txt](https://nuxt-backend.dev/llms.txt) · Skill for coding agents: [nuxt-backend](https://nuxt-backend.dev/.well-known/skills/nuxt-backend/SKILL.md)

Commands use npm; use your project's package manager.

Add the package to a Nuxt app with one command, then start it once. nuxt-backend is one Nuxt module: it goes in `modules`, never in `extends` ([Principles](https://nuxt-backend.dev/docs/start/concepts/principles#one-module-not-a-nuxt-layer)). For a new app, [create it from the starter](https://nuxt-backend.dev/docs/start/templates#starter) instead: the module is installed and the files are written.

## Before you start

- **Nuxt 4.7.0 or later**, not Nuxt 5 yet: the server code is written against `nuxt/server`, a 4.6 API, and Nuxt 4.6 no longer builds with Vite 8.4 ([Roadmap](https://nuxt-backend.dev/docs/start/roadmap#upstream-releases-the-package-holds-for)).
- **Node 24.11 or later**, the package's `engines` floor.
- No Convex account: the first run can create a local deployment, and [Run the dev loop](https://nuxt-backend.dev/docs/develop/dev-loop) says how to move to a cloud one. The [Service map](https://nuxt-backend.dev/docs/services) lists the accounts each later step asks for.

## Install

<tabs>
<tabs-item icon="i-lucide-bot" label="Agent">

Paste this prompt into Claude Code, Cursor, Codex or any agent that can run commands in your project:

```text
Install nuxt-backend, the all-in-one SaaS backend for Nuxt on Convex, in this project:
run `npx -y skills@1.7.0 add https://nuxt-backend.dev --skill nuxt-backend -y`,
then follow .agents/skills/nuxt-backend/references/install.md.
```

Or open it in your agent with the prompt typed in:

- Claude Code (Anthropic): [Claude app](claude://code/new?q=Install%20nuxt-backend%2C%20the%20all-in-one%20SaaS%20backend%20for%20Nuxt%20on%20Convex%2C%20in%20this%20project%3A%0Arun%20%60npx%20-y%20skills%401.7.0%20add%20https%3A%2F%2Fnuxt-backend.dev%20--skill%20nuxt-backend%20-y%60%2C%0Athen%20follow%20.agents%2Fskills%2Fnuxt-backend%2Freferences%2Finstall.md.), [VS Code](vscode://anthropic.claude-code/open?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [Cursor](cursor://anthropic.claude-code/open?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [Windsurf](windsurf://anthropic.claude-code/open?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [Insiders](vscode-insiders://anthropic.claude-code/open?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [VSCodium](vscodium://anthropic.claude-code/open?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [Kiro](kiro://anthropic.claude-code/open?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [Antigravity](antigravity-ide://anthropic.claude-code/open?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [Trae](trae://anthropic.claude-code/open?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [Positron](positron://anthropic.claude-code/open?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [Web](https://claude.ai/code?prompt=Install%20nuxt-backend%2C%20the%20all-in-one%20SaaS%20backend%20for%20Nuxt%20on%20Convex%2C%20in%20this%20project%3A%0Arun%20%60npx%20-y%20skills%401.7.0%20add%20https%3A%2F%2Fnuxt-backend.dev%20--skill%20nuxt-backend%20-y%60%2C%0Athen%20follow%20.agents%2Fskills%2Fnuxt-backend%2Freferences%2Finstall.md.)
- Cursor (Anysphere): [Cursor](cursor://anysphere.cursor-deeplink/prompt?text=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.)
- Codex (OpenAI): [Codex app](codex://new?prompt=Install%20nuxt-backend%2C%20the%20all-in-one%20SaaS%20backend%20for%20Nuxt%20on%20Convex%2C%20in%20this%20project%3A%0Arun%20%60npx%20-y%20skills%401.7.0%20add%20https%3A%2F%2Fnuxt-backend.dev%20--skill%20nuxt-backend%20-y%60%2C%0Athen%20follow%20.agents%2Fskills%2Fnuxt-backend%2Freferences%2Finstall.md.)
- Copilot (GitHub): [VS Code](vscode://GitHub.Copilot-Chat/chat?mode=agent&prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.), [Insiders](vscode-insiders://GitHub.Copilot-Chat/chat?mode=agent&prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.)
- Cascade (Cognition): [Windsurf](windsurf://cascade?prompt=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.)
- Zed (Zed Industries): [Zed](zed://agent?prompt=Install%20nuxt-backend%2C%20the%20all-in-one%20SaaS%20backend%20for%20Nuxt%20on%20Convex%2C%20in%20this%20project%3A%0Arun%20%60npx%20-y%20skills%401.7.0%20add%20https%3A%2F%2Fnuxt-backend.dev%20--skill%20nuxt-backend%20-y%60%2C%0Athen%20follow%20.agents%2Fskills%2Fnuxt-backend%2Freferences%2Finstall.md.)
- Trae (ByteDance): [Trae](trae://trae.ai-ide/side-chat?query=Install%2520nuxt-backend%252C%2520the%2520all-in-one%2520SaaS%2520backend%2520for%2520Nuxt%2520on%2520Convex%252C%2520in%2520this%2520project%253A%250Arun%2520%2560npx%2520-y%2520skills%25401.7.0%2520add%2520https%253A%252F%252Fnuxt-backend.dev%2520--skill%2520nuxt-backend%2520-y%2560%252C%250Athen%2520follow%2520.agents%252Fskills%252Fnuxt-backend%252Freferences%252Finstall.md.)

The agent installs the package's core [skill](https://nuxt-backend.dev/docs/develop/agents#the-agent-skills), then follows its install guide. The guide adds the package to an existing app (or creates one from the [starter](https://nuxt-backend.dev/docs/start/templates#starter)), starts it on a local deployment that needs no account, and checks that the app serves `/login`. It asks before it logs in to Convex or touches your accounts, and it never prints or replaces `AUTH_SECRET`. The skill stays in the project for later tasks, and the install adds the task skills of the installed version beside it.

</tabs-item>

<tabs-item icon="i-lucide-terminal" label="CLI">

```bash
npx nuxt module add nuxt-backend
```

`nuxt module add` installs the package, adds `'nuxt-backend'` to `modules`, then runs the module's install step. That step:

- installs `convex`, the one peer an app lists itself, since `npx convex dev` refuses to start until the app's own `package.json` names it (Nuxt brings `vue`; optional peers such as `ai` or `@sentry/nuxt` wait until a feature needs them);
- writes the backend files into `backend/` (or the functions folder `convex.json` names), never over a file that exists;
- writes `.env.example`, grouped by purpose;
- points the `dev` script at `nuxt-backend dev`;
- swaps `<NuxtWelcome />` for `<NuxtPage />` in an untouched `app/app.vue`, so the module's pages render;
- writes a home page, `app/pages/index.vue`, when no page answers `/` and the app extends no layer, which may serve `/` itself: the app's name and a link to sign in, or to the account once signed in;
- writes an `AGENTS.md` section, the agent skills and the one `nuxt-backend` entry in `.mcp.json` for the developer MCP server, and under pnpm 12 tells pnpm not to link a second copy of the skills ([Using strict pnpm](#using-strict-pnpm));
- asks the few questions it needs, such as whether to write the agent files, in the terminal.

`npx nuxt-backend init` runs the same setup again later, and restores a file that went missing. [`init`](https://nuxt-backend.dev/docs/reference/cli#init) lists every flag, and [Project files](https://nuxt-backend.dev/docs/reference/configuration/project-files) every file it writes.

</tabs-item>

<tabs-item icon="i-lucide-hand" label="By hand">

Install the two packages, then add the module:

```bash
npm install nuxt-backend convex
```

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  modules: ['nuxt-backend'],
})
```

Then write the backend files with `npx nuxt-backend init --no-agents`, which never touches a file that exists. If you skip `init` entirely, make its two edits yourself: render `<NuxtPage />` in `app/app.vue` instead of `<NuxtWelcome />`, and point the `dev` script at `nuxt-backend dev`, which [Run the dev loop](https://nuxt-backend.dev/docs/develop/dev-loop) explains. Give the app a page at `/` too, if it has none: the module's pages turn on the router, and `/` answers 404 without one.

**An app on nuxt-convex-module already**: keep its entry in `modules` and its options. `nuxt-backend` installs and configures that module itself, and forces the few options it depends on ([nuxt-backend and nuxt-convex-module](https://nuxt-backend.dev/docs/start/concepts/nuxt-convex-module)). Your `convex/` folder stays where it is: the files go there beside yours, and an existing `convex.config.ts`, `http.ts`, `schema.ts` or `auth.config.ts` is kept, so merge the package's parts into them as [Auth setup](https://nuxt-backend.dev/docs/build/auth/setup) shows.

</tabs-item>
</tabs>

## Start it

```bash
npm run dev
```

The first run sets up a dev deployment when none is configured: log in to Convex when it asks, or pick **Start without an account** for a local one. `npx nuxt-backend dev --anonymous` picks the local one without asking, on every OS. It writes `CONVEX_DEPLOYMENT` to `.env.local`, gives the deployment its `AUTH_SECRET`, `SITE_URL` and `BACKEND_ENVIRONMENT`, then runs Convex and Nuxt in this terminal. Nothing goes in `.env` by hand: the backend's URL derives from the deployment's name.

## Check it works

Open `/login` and sign in: with no email provider connected, the code prints in the terminal. `npx nuxt-backend doctor` checks the project and the deployment and names whatever is missing ([Diagnose your setup](https://nuxt-backend.dev/docs/develop/doctor)).

## Using strict pnpm

A flat `node_modules` (npm, Yarn, or pnpm with `nodeLinker: hoisted`) exposes the bundled Convex components to Convex's bundler. pnpm's default isolated layout hides them, so let them reach the project root from `pnpm-workspace.yaml` (pnpm 11 and later read their settings there, not from `.npmrc`):

```yaml [pnpm-workspace.yaml]
publicHoistPattern:
  - '@convex-dev/*'
```

Without it, the first `convex dev` push fails to resolve the component definitions. The Nuxt side needs nothing: the module installs `nuxt-convex-module` and `nuxt-security` from its own dependencies. Apps made from the [templates](https://nuxt-backend.dev/docs/start/templates) carry this setting in a `.pnpmfile.mjs`.

pnpm 11 and later hold back a version published less than a day ago (`minimumReleaseAge`). An install takes an older version that fits the range, and the new one only when nothing older fits. A project that sets `minimumReleaseAge` itself fails the install in that case. pnpm also stops an install until each dependency build script is approved or denied (`pnpm approve-builds`, or `pnpm approve` on pnpm 12). `esbuild` comes in through Nuxt and works without its script, so denying it is safe. Both are pnpm's own supply-chain defaults.

pnpm 12 links the agent skills a dependency ships once you approve them, and lists nuxt-backend under "Agent skills awaiting approval" until then. `init` already installs those skills in `.agents/skills` and keeps them on the version you have installed, so a second copy would show your agent each skill twice. Under pnpm 12.11 or later, `init` denies that copy itself: it adds `skills: false` for nuxt-backend under `permissions` in `pnpm-workspace.yaml`, the entry `pnpm approve '!nuxt-backend'` records, creating the file when the project has none and keeping every other key and comment. A `skills` entry nuxt-backend has there already stays as it is, an approval included: set it to `false` yourself to deny the copy. pnpm 11 doesn't read `permissions` and warns about the key on every install, so under pnpm 11 `init` leaves the file alone. After a move to pnpm 12, `npx nuxt-backend init --agents` adds the entry, or `pnpm approve '!nuxt-backend'` records it.

## If it fails

<table>
<thead>
  <tr>
    <th>
      Symptom
    </th>
    
    <th>
      Fix
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        convex dev
      </code>
      
       can't resolve <code>
        @convex-dev/…/convex.config
      </code>
    </td>
    
    <td>
      Hoist the components: <a href="#using-strict-pnpm">
        Using strict pnpm
      </a>
      
      .
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        npx convex dev
      </code>
      
       says to add <code>
        convex
      </code>
      
       to your dependencies
    </td>
    
    <td>
      Install <code>
        convex
      </code>
      
       in the app itself (<a href="https://nuxt-backend.dev/docs/ship/operate/troubleshooting#npx-convex-dev-says-add-convex-to-your-packagejson-dependencies">
        Troubleshooting
      </a>
      
      ).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        /login
      </code>
      
       shows the Nuxt welcome page
    </td>
    
    <td>
      Render <code>
        <NuxtPage />
      </code>
      
       in <code>
        app/app.vue
      </code>
      
       (<a href="https://nuxt-backend.dev/docs/ship/operate/troubleshooting#login-shows-the-nuxt-welcome-page">
        Troubleshooting
      </a>
      
      ).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        /
      </code>
      
       answers 404, and the dev log says <code>
        No match found for location with path "/"
      </code>
    </td>
    
    <td>
      The app has no page at <code>
        /
      </code>
      
      : run <code>
        npx nuxt-backend init
      </code>
      
      , which writes one unless the app extends a layer, or add <code>
        app/pages/index.vue
      </code>
      
       yourself (<a href="https://nuxt-backend.dev/docs/ship/operate/troubleshooting#the-home-page-answers-404">
        Troubleshooting
      </a>
      
      ).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        npm run dev
      </code>
      
       stops at "Preparing Convex functions"
    </td>
    
    <td>
      The <code>
        dev
      </code>
      
       script is <code>
        convex dev --start "nuxt dev"
      </code>
      
      : run <code>
        npx nuxt-backend doctor --fix
      </code>
      
       (<a href="https://nuxt-backend.dev/docs/ship/operate/troubleshooting#npm-run-dev-stops-at-preparing-convex-functions-and-nuxt-never-starts">
        Troubleshooting
      </a>
      
      ).
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        nuxt module add
      </code>
      
       wrote no <code>
        backend/
      </code>
      
       folder
    </td>
    
    <td>
      The install step runs only in an interactive terminal. Run <code>
        npx nuxt-backend init
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

## Related

- [Quickstart](https://nuxt-backend.dev/docs/start/quickstart): from here to a signed-in app and credits spent.
- [Build a creative app](https://nuxt-backend.dev/docs/start/tutorial): the tutorial, from here to an app in production.
- [Environment variables](https://nuxt-backend.dev/docs/reference/configuration/environment-variables): every name, what sets it and what its absence does.
- [Upgrade](https://nuxt-backend.dev/docs/ship/releases/upgrade): moving to a new release with `npx nuxt-backend upgrade`.


## Sitemap

See the full [sitemap](https://nuxt-backend.dev/sitemap.md) for all pages.
