> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shardcloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Host Nuxt Applications

> Learn how to deploy Nuxt applications on Shard Cloud.

## Introduction

This guide covers deploying Nuxt applications on Shard Cloud. Nuxt is a Vue.js framework for server-side rendering and static site generation.

## Creating Your Project

Ensure you have **Node.js** and **npm** installed.

### Creating a New Nuxt Project

```bash theme={null}
npx nuxi init my-nuxt-app
cd my-nuxt-app
npm install
```

### Development Server

```bash theme={null}
npm run dev
```

## Building Your Project

Build the production output:

```bash theme={null}
npm run build
```

This creates the `.output` folder with the server and static files.

## Shard Cloud Configuration

Create a `.shardcloud` file:

```systemd .shardcloud theme={null}
DISPLAY_NAME=Nuxt App
DESCRIPTION=Nuxt.js Application
MAIN=.output/server/index.mjs
MEMORY=512
VERSION=recommended
SUBDOMAIN=my-nuxt-app
```

<Note>
  The main file for Nuxt 3 is `.output/server/index.mjs` after building.
</Note>

## Deploying

<Steps>
  <Step title="Build Your Application">
    Run `npm run build` to generate the `.output` folder.
  </Step>

  <Step title="Prepare Your Files">
    Ensure you have:

    * `.output/` folder (after build)
    * `package.json`
    * `.shardcloud`
  </Step>

  <Step title="Exclude Unnecessary Files">
    Remove: `node_modules/`, `.nuxt/`, `package-lock.json`
  </Step>

  <Step title="Create ZIP Archive">
    Compress your project folder including the `.output` folder.
  </Step>

  <Step title="Upload to Shard Cloud">
    Go to [Shard Cloud Dashboard](https://shardcloud.app/dash/applications) and upload.
  </Step>
</Steps>

## Alternative: Build on Deploy

If you prefer to build on the server:

```systemd .shardcloud theme={null}
DISPLAY_NAME=Nuxt App
DESCRIPTION=Nuxt.js Application
LANGUAGE=node
MEMORY=1024
VERSION=recommended
SUBDOMAIN=my-nuxt-app
CUSTOM_COMMAND=npm run build && node .output/server/index.mjs
```

<Warning>
  Building on deploy requires more memory. Use at least 1024MB.
</Warning>

## Additional Resources

Visit the [official Nuxt documentation](https://nuxt.com/docs) for more information.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Build fails">
    * Ensure all dependencies are in `package.json`
    * Check for TypeScript errors
    * Increase memory if needed
  </Accordion>

  <Accordion title="Server not starting">
    Verify the `.output` folder was created and contains `server/index.mjs`.
  </Accordion>
</AccordionGroup>
