Nuxt 3 Release Candidate is out! Discover more about it on v3.nuxtjs.org

Deploy Nuxt on Layer0

How to deploy Nuxt app on Layer0?


Layer0 supports universal (SSR) Nuxt applications.

Layer0 is an all-in-one platform to develop, deploy, preview, experiment on, monitor, and run your headless frontend. It is focused on large, dynamic websites and best-in-class performance through EdgeJS (a JavaScript-based Content Delivery Network), predictive prefetching, and performance monitoring. Layer0 offers a free tier.

For detailed instructions consult the Layer0 Nuxt documentation .

Getting Started

  1. Sign up for a free account on Layer0's signup page .
  2. Install the Layer0 CLI
Yarn
yarn global add @layer0/cli
NPM
npm i -g @layer0/cli

Configure your project

  1. Make sure server side rendering is enabled and in your nuxt.config.js add the @layer0/nuxt module:
// nuxt.config.js

module.exports = {
  modules: ['@layer0/nuxt/module']
}
  1. Run layer0 init which will configure your project for Layer0.

Running and deploying your project

  1. To test your app locally, run the following in your project directory:
layer0 run
  1. To deploy your app, run the following in your project directory:
layer0 deploy

Optimize your project's performance

  • (Optional) To optimize the performance of server side rendering in Nuxt, Layer0 recommends moving most your modules into buildModules as described in the modules vs buildModules section of the Layer0 Nuxt guide.
  • (Optional) Layer0 automatically supports Nuxt's built-in routing scheme. However you can and should optimize the performance by customizing the routing, caching, and prefetching via EdgeJS as shown in the Routing section of the Layer0 Nuxt guide.

Get help

If you have issues please check the Troubleshooting section of the guide or create a ticket in the forums .

Edit this page on GitHub Updated at Sat, Sep 24, 2022