---
description: Learn how Wrangler automatically detects and configures your project for Cloudflare Workers.
title: Deploy an existing project
image: https://developers.cloudflare.com/og-docs.png
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/workers/llms.txt  
> Use this file to discover all available pages before exploring further.

# Deploy an existing project

Last updated Aug 1, 2026|Copy as Markdown|[View as Markdown](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/automatic-configuration/index.md)|[Agent setup](https://4f1c5cd2.previews.developers.cloudflare.com/agent-setup/)

Wrangler can automatically detect your framework and configure your project for Cloudflare Workers. This allows you to deploy existing projects with a single command, without manually setting up configuration files or installing adapters.

Note

Minimum required Wrangler version: **4.68.0**. Check your version by running `wrangler --version`. To update Wrangler, refer to [Install/Update Wrangler](https://4f1c5cd2.previews.developers.cloudflare.com/workers/wrangler/install-and-update/).

## How it works

When you run `wrangler deploy` or `wrangler setup` in a project directory without a Wrangler configuration file, Wrangler will:

1. **Detect your framework** \- Analyzes your project to identify the framework you're using
2. **Prompt for confirmation** \- Shows the detected settings and asks you to confirm before making changes
3. **Install adapters** \- Installs any required Cloudflare adapters for your framework
4. **Generate configuration** \- Creates a `wrangler.jsonc` file with appropriate settings
5. **Update package.json** \- Adds helpful scripts like `deploy`, `preview`, and `cf-typegen`
6. **Configure git** \- Adds Wrangler-specific entries to `.gitignore`

## Supported frameworks

Automatic configuration supports the following frameworks:

| Framework                                                                                                                       | Adapter/Tool                 | Notes                                                                                           |
| ------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- | ----------------------------------------------------------------------------------------------- |
| [Next.js](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/nextjs/)                        | vinext                       | Configures vinext for Cloudflare Workers and adds the required Vite and Wrangler configuration. |
| [Astro](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/astro/)                           | @astrojs/cloudflare          | Runs astro add cloudflare automatically                                                         |
| [SvelteKit](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/sveltekit/)                   | @sveltejs/adapter-cloudflare | Runs sv add sveltekit-adapter automatically                                                     |
| [Nuxt](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/more-web-frameworks/nuxt/)         | Built-in Cloudflare preset   |                                                                                                 |
| [React Router](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/react-router/)             | Cloudflare Vite plugin       |                                                                                                 |
| [Solid Start](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/more-web-frameworks/solid/) | Built-in Cloudflare preset   |                                                                                                 |
| [TanStack Start](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/tanstack-start/)         | Cloudflare Vite plugin       |                                                                                                 |
| [Angular](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/more-web-frameworks/angular/)   |                              |                                                                                                 |
| [Analog](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/more-web-frameworks/analog/)     | Built-in Cloudflare preset   |                                                                                                 |
| [Vite](https://4f1c5cd2.previews.developers.cloudflare.com/workers/vite-plugin/)                                                | Cloudflare Vite plugin       |                                                                                                 |
| [Vike](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/vike/)                             |                              |                                                                                                 |
| [Waku](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/more-web-frameworks/waku/)         |                              |                                                                                                 |
| Static sites                                                                                                                    | None                         | Any directory with an index.html                                                                |

Automatic configuration may also work with other projects, such as React or Vue SPAs. Try running `wrangler deploy` or `wrangler setup` to see if your project is detected.

## Files created and modified

When automatic configuration runs, the following files may be created or modified:

### `wrangler.jsonc`

A new Wrangler configuration file is created with settings appropriate for your framework:

```jsonc
{
	"$schema": "node_modules/wrangler/config-schema.json",
	"name": "my-project",
	"main": "dist/_worker.js/index.js",
	// Set this to today's date
	"compatibility_date": "2026-08-25",
	"compatibility_flags": ["nodejs_compat"],
	"assets": {
		"binding": "ASSETS",
		"directory": "dist",
	},
	"observability": {
		"enabled": true,
	},
}
```

```toml
"$schema" = "node_modules/wrangler/config-schema.json"
name = "my-project"
main = "dist/_worker.js/index.js"
# Set this to today's date
compatibility_date = "2026-08-25"
compatibility_flags = [ "nodejs_compat" ]

[assets]
binding = "ASSETS"
directory = "dist"

[observability]
enabled = true
```

The exact configuration varies based on your framework.

### `package.json`

New scripts are added to your `package.json`:

```json
{
	"scripts": {
		"deploy": "npm run build && wrangler deploy",
		"preview": "npm run build && wrangler dev",
		"cf-typegen": "wrangler types"
	}
}
```

### `.gitignore`

Wrangler-specific entries are added:

```txt
# wrangler files
.wrangler
.dev.vars*
!.dev.vars.example
```

### `.assetsignore`

For frameworks that generate worker files in the output directory, an `.assetsignore` file is created to exclude them from static asset uploads:

```txt
_worker.js
_routes.json
```

## Using automatic configuration

### Deploy with automatic configuration

To deploy an existing project, run [wrangler deploy](https://4f1c5cd2.previews.developers.cloudflare.com/workers/wrangler/commands/general/#deploy) in your project directory:

npmyarnpnpm

```
npx wrangler deploy
```

```
yarn wrangler deploy
```

```
pnpm wrangler deploy
```

Wrangler will detect your framework, show the configuration it will apply, and prompt you to confirm before making changes and deploying.

### Configure without deploying

To configure your project without deploying, use [wrangler setup](https://4f1c5cd2.previews.developers.cloudflare.com/workers/wrangler/commands/general/#setup):

npmyarnpnpm

```
npx wrangler setup
```

```
yarn wrangler setup
```

```
pnpm wrangler setup
```

This is useful when you want to review the generated configuration before deploying.

### Preview changes with dry run

To see what changes would be made without actually modifying any files:

npmyarnpnpm

```
npx wrangler setup --dry-run
```

```
yarn wrangler setup --dry-run
```

```
pnpm wrangler setup --dry-run
```

This outputs a summary of the configuration that would be generated.

## Non-interactive mode

To skip the confirmation prompts, use the [\--yes flag](https://4f1c5cd2.previews.developers.cloudflare.com/workers/wrangler/commands/general/#deploy):

npmyarnpnpm

```
npx wrangler deploy --yes
```

```
yarn wrangler deploy --yes
```

```
pnpm wrangler deploy --yes
```

This applies the configuration automatically using sensible defaults. This is useful in CI/CD environments or when you want to accept the detected settings without reviewing them.

## Importing a repository from the dashboard

When you import a GitHub or GitLab repository via the Cloudflare dashboard, autoconfig runs non-interactively. If your repository does not have a Wrangler configuration file, [Workers Builds](https://4f1c5cd2.previews.developers.cloudflare.com/workers/ci-cd/builds/) will create a pull request with the necessary configuration.

The PR includes all the configuration changes described above. A preview deployment is generated so you can test the changes before merging. Once merged, your project is ready for deployment.

For more details, refer to [Automatic pull requests](https://4f1c5cd2.previews.developers.cloudflare.com/workers/ci-cd/builds/automatic-prs/).

## Skipping automatic configuration

If you do not want automatic configuration to run, ensure you have a valid Wrangler configuration file (`wrangler.toml`, `wrangler.json`, or `wrangler.jsonc`) in your project before running `wrangler deploy`.

You can also manually configure your project by following the framework-specific guides in the [Framework guides](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/).

## Next.js configuration

For Next.js projects, automatic configuration uses [vinext](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/nextjs/) as the default deployment path for Cloudflare Workers. The generated configuration adds the vinext and Vite dependencies, creates the Cloudflare Workers configuration, and adds package scripts for development, builds, and deployment.

vinext supports Next.js caching features such as Incremental Static Regeneration (ISR), `"use cache"`, and `unstable_cache`. For production applications, configure the generated Workers project with the cache backend your application requires. For more information, refer to [vinext caching ↗](https://github.com/cloudflare/vinext#caching).

If you need the OpenNext adapter instead of vinext, configure it manually by following the [OpenNext adapter guide](https://4f1c5cd2.previews.developers.cloudflare.com/workers/framework-guides/web-apps/opennext/).

## Troubleshooting

### Multiple frameworks detected

When you import a repository via [Workers Builds](https://4f1c5cd2.previews.developers.cloudflare.com/workers/ci-cd/builds/) in the Cloudflare dashboard, automatic configuration will fail if your project contains multiple frameworks. To resolve this, set the [root directory](https://4f1c5cd2.previews.developers.cloudflare.com/workers/ci-cd/builds/configuration/#build-settings) to the path containing only one framework. For monorepos, refer to [monorepo setup](https://4f1c5cd2.previews.developers.cloudflare.com/workers/ci-cd/builds/advanced-setups/#monorepos).

When running `wrangler deploy` or `wrangler setup` locally, Wrangler will prompt you to select which framework to use if multiple frameworks are detected.

### Framework not detected

If your framework is not detected, ensure your `package.json` includes the framework as a dependency.

### Configuration already exists

If a Wrangler configuration file already exists, automatic configuration will not run. To reconfigure your project, delete the existing configuration file and run `wrangler deploy` or `wrangler setup` again.

### Workspaces

Support for monorepos and npm/yarn/pnpm workspaces is currently limited. Wrangler analyzes the project directory where you run the command, but does not detect dependencies installed at the workspace root. This can cause framework detection to fail if the framework is listed as a dependency in the workspace's root `package.json` rather than in the individual project's `package.json`.

If you encounter issues, report them in the [Wrangler GitHub repository ↗](https://github.com/cloudflare/workers-sdk/issues/new/choose).

Was this helpful?

YesNo

## On this page

[![](https://4f1c5cd2.previews.developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://4f1c5cd2.previews.developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/workers/framework-guides/automatic-configuration/#page","headline":"Deploy an existing project · Cloudflare Workers docs","description":"Learn how Wrangler automatically detects and configures your project for Cloudflare Workers.","url":"https://developers.cloudflare.com/workers/framework-guides/automatic-configuration/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","dateModified":"2026-08-01","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```
