Getting Started

Deploy

How to deploy your project with NuxtHub on your Cloudflare account.

To deploy your Nuxt application on the Edge, we use Cloudflare Pages. Therefore, we require you to create a Cloudflare account. You can deploy NuxtHub projects with a free Cloudflare account.

NuxtHub Console (alpha)

The NuxtHub Console is made to simplify your experience with NuxtHub, enabling you to effortlessly manage teams and projects, as well as deploy in seconds combined with the NuxtHub CLI.

After linking your Cloudflare account in the console, deploy your project with a single command:

Terminal
npx nuxthub deploy

The command will:

  1. Ensure you are logged in on console.hub.nuxt.com
  2. Link your local project with a NuxtHub project (or create a new one)
  3. Build your Nuxt project with the correct preset
  4. Deploy it to your Cloudflare account with all the necessary resources
  5. Provide you with a URL to access your project
Install the NuxtHub CLI globally with: npm i -g nuxthub.

Self-hosted

You can deploy your project on your own Cloudflare account without using the NuxtHub Console.

For that, you need to create the necessary resources in your Cloudflare account and configure your project to use them:

Then, create a Cloudflare Pages project and link your GitHub or Gitlab repository and choose the Nuxt Framework preset in the build settings.

Once your project is created, open the Settings -> Functions tab and set:

  • Placement: Smart
  • KV namespace bindings
    • KV -> select your KV namespace created
    • CACHE -> select your KV namespace for caching created
  • R2 bucket bindings
    • BLOB -> select your R2 bucket created
  • D1 database bindings
    • DB -> select your D1 database created

Go back to the Deployment tab and retry the last deployment by clicing on ... then Retry deployment.

Once the deployment is done, NuxtHub should be ready to use in your deployed project.


Copyright NuxtLabs © 2024