# Source: https://content.nuxt.com/raw/docs/deploy/cloudflare-workers.md

# Cloudflare Workers

> Deploy your Content app to Cloudflare Workers

<card>

Quick Setup

1. Use `cloudflare_module` preset and compatibility date of `2024-09-19` or later.
2. Create a D1 database and connect it to your project in the Cloudflare Dashboard under the `DB` binding name, and configure the database configuration in the `nuxt.config.ts` file.
3. Build and deploy your app

</card>

---

The Nuxt Content module has a built-in integration with [Cloudflare Workers](https://workers.cloudflare.com) to deploy your content.

The module will automatically detect the build target and prepare the necessary configuration for Cloudflare Workers.

All you need to do is create a Cloudflare D1 database and connect it to your project. After creating a D1 database, you should
define the database configuration in the `nuxt.config.ts` file with the `nitro.cloudflare.wrangler.d1_databases` option.

By default, the module will use the `DB` binding name. You can override the database configuration by providing your own database configuration in `nuxt.config.ts`.

```ts [nuxt.config.ts]
export default defineNuxtConfig({
  compatibilityDate: "2025-05-15",
  nitro: {
    preset: 'cloudflare_module',
    cloudflare: {
      deployConfig: true,
      wrangler: {
        d1_databases: [
          {
            binding: 'DB',
            database_name: 'database-name',
            database_id: '*********-***-****-****-*********'
          }
        ]
      },
    },
  }
})
```

<note>

If you want to use a different binding name, you can override the database configuration by providing your own database configuration in `nuxt.config.ts`. Check out [Database Configuration](/docs/getting-started/configuration#d1)

</note>

<note>

To deploy a Nuxt project to Cloudflare Workers, you need to use a compatibility date of `2024-09-19` or later.

</note>

Build your project with the `nuxi build` command, and you can deploy the project with the `wrangler deploy` command.

```bash
npx wrangler deploy
```

That's it! 🎉

Check out:

- [Nuxt Deploy documentation](https://nuxt.com/deploy/cloudflare)
- [Cloudflare D1 documentation](https://developers.cloudflare.com/d1/)
- [Cloudflare Workers documentation](https://developers.cloudflare.com/workers/)