Learn Nuxt with a Collection of 100+ Tips!
Deploy

Zerops

Deploy your Nuxt Application to Zerops infrastructure.

Nodejs Preset: SERVER_PRESET: zeropsStatic Preset: SERVER_PRESET: zerops-static

Read more in Zerops.
Nuxt x Zerops Quickrun ✨
Want to test running Nuxt on Zerops without installing or setting up anything? Using repositories Zerops x Nuxt - Static or Zerops x Nuxt - SSR on Node.js you can deploy example Nuxt app with a single click.

Zerops supports deploying both static and server-side rendered apps with a simple configuration file in your project root.

Static

Projects and services can be added either through a Project add wizard or imported using a YAML structure:

Creating a Project

zerops-project-import.yml
project:
  name: recipe-nuxt

services:
  - hostname: app
    type: static

This will create a project called recipe-nuxt with a Zerops Static service called app.

Setting up Zerops YAML

To tell Zerops how to build and run your app, add a zerops.yml to your root:

zerops.yml
zerops:
  - setup: app
    build:
      base: nodejs@20
      buildCommands:
        - yarn
        - yarn nuxi generate
      deployFiles:
        - .output/public/~
    run:
      base: static

Now you can trigger the build & deploy pipeline using the Zerops CLI or by connecting the app service with your GitHub / GitLab repository from inside the service detail.

SSR Node.js

Projects and services can be added either through a Project add wizard or imported using a YAML structure:

zerops-project-import.yml
project:
  name: recipe-nuxt

services:
  - hostname: app
    type: nodejs@20

This will create a project called recipe-nuxt with a Zerops Static service called app.

Setting up Zerops YAML

To tell Zerops how to build and run your app, add a zerops.yml to your root:

zerops.yml
zerops:
  - setup: nuxt
    build:
      base: nodejs@18
      prepareCommands:
        - node -v
      buildCommands:
        - yarn
        - yarn build
      deployFiles:
        - .output/~
    run:
      base: nodejs@18
      ports:
        - port: 3000
          httpSupport: true
      start: node server/index.mjs

Now you can trigger the build & deploy pipeline using the Zerops CLI or by connecting the app service with your GitHub / GitLab repository from inside the service detail.

Building & Deploying your App

npm i -g @zerops/zcli
zcli login <token>
  • Navigate to the root of your app (where zerops.yml is located) and run the following command to trigger the deploy:
zcli push

Your code can be deployed automatically on each commit or a new tag by connecting the service with your GitHub / GitLab repository. This connection can be set up in the service detail.

Read more in Zerops Documentation.