Deploy
You can deploy NuxtHub projects with a free Cloudflare account.
NuxtHub Admin
The NuxtHub Admin is made to simplify your experience with NuxtHub, enabling you to effortlessly manage teams and projects, as well as deploying NuxtHub application with zero-configuration on your Cloudflare account.
Quickstart
- Login to https://admin.hub.nuxt.com
- Connect your Cloudflare account by clicking on
Create a new token with required permissions
and follow the instructions - You are now ready to deploy your Nuxt project to your Cloudflare account!
Cloudflare Pages CI
It is possible to use Cloudflare Pages CI to deploy your project by connecting your GitHub or GitLab account. Once your repository is connected, each commit will trigger a new deployment.
- Open the NuxtHub Admin
- Click on
New Project
thenImport a GitHub repository
- Select your Github repository
- Click on
Import repository
NuxtHub CLI
You can deploy your local project with a single command:
npx nuxthub deploy
The command will:
- Ensure you are logged in on admin.hub.nuxt.com
- Link your local project with a NuxtHub project or help you create a new one
- Build your Nuxt project with the correct preset
- Deploy it to your Cloudflare account with all the necessary resources
- Provide you with a URL to access your project
npm i -g nuxthub
.Self-hosted
You can deploy your project on your own Cloudflare account without using the NuxtHub Admin.
For that, you need to create the necessary resources in your Cloudflare account and configure your project to use them:
- One D1 database
- Two KV namespaces (one for
hubKV()
and one for server caching) - One R2 bucket
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
- Set the variable name as
KV
and select your KV namespace created - Set the variable name as
CACHE
and select your KV namespace for caching created
- Set the variable name as
- R2 bucket bindings
- Set the variable name as
BLOB
and select your R2 bucket created
- Set the variable name as
- D1 database bindings
- Set the variable name as
DB
and select your D1 database created
- Set the variable name as
Go back to the Deployment
tab and retry the last deployment by clicking on ...
then Retry deployment
.
npx nuxt dev --remote
after configuring the remote storage