Configuration

Webflow Cloud is designed to handle most of your deployment configuration, so you can focus on building your app. This page explains what’s configured automatically and what you need to know if you want to understand or troubleshoot the process.

For step-by-step setup use the following guides:

Deployment details

Webflow Cloud hosts your app on Cloudflare Workers, running it at a base path within your Webflow Cloud environment (for example, /app). This base path serves as the mount point for your application.

When you deploy your environment, Webflow Cloud uses Wrangler, Cloudflare’s official CLI, to deploy your app to the Workers platform with a standard configuration.

Default configuration

When you deploy an environment in Webflow Cloud, Webflow automatically sets up the necessary configuration for deployment to the Workers platform.

During deployment, Webflow Cloud generates a wrangler.json configuration file based on the framework specified in your webflow.json file. This file includes recommended defaults for:

  • Asset handling
  • Node.js API compatibility
  • Observability (for example, logging and metrics)

This production file is generated automatically and can’t be edited directly. For more details on Wrangler configuration, see the Wrangler documentation.

wrangler.json
1{
2 "$schema": "node_modules/wrangler/config-schema.json",
3 "name": "nextjs",
4 "main": ".open-next/worker.js",
5 "compatibility_date": "2025-03-01",
6 "compatibility_flags": [
7 "nodejs_compat"
8 ],
9 "assets": {
10 "binding": "ASSETS",
11 "directory": ".open-next/assets"
12 },
13 "observability": {
14 "enabled": true
15 },
16
17 // Storage resources = Beta
18 "kv_namespaces": [
19 {
20 "binding": "KV",
21 "id": "1234567890" // Webflow Cloud will automatically generate an ID for your environment
22 }
23 ],
24 "d1_databases": [
25 {
26 "binding": "DB",
27 "database_name": "my-database",
28 "database_id": "1234567890", // Webflow Cloud will automatically generate an ID for your environment,
29 "migrations_dir": "./migrations" // Specify the directory containing your migrations
30 }
31 ]
32}

Storage resources

If your app requires storage, you can declare storage bindings in your wrangler.json file. Webflow Cloud reads these bindings during deployment and automatically creates the corresponding storage resources in your environment. All other configuration values remain managed by Webflow Cloud and can’t be modified directly. Learn more about storage in Webflow Cloud..

Framework configuration

Some frameworks require additional configuration to run on Webflow Cloud and the Workers runtime. If you’ve created a new project using the Webflow Cloud CLI, Webflow Cloud will automatically add the necessary configuration files to your project. If you’ve brought your own app, you’ll need to add the necessary files to your project.

Next.js apps require the following files:

  • next.config.js: Configures your environment’s mount path and adapter settings.
  • .open-next.config.ts: Optimizes Next.js for the edge runtime.
  • cloudflare.env.ts: Enables your app to access your environment variables.
1import type { NextConfig } from "next";
2
3const nextConfig: NextConfig = {
4 basePath: "/YOUR_BASE_PATH", // your environment's mount path
5 assetPrefix: '/YOUR_BASE_PATH', // ensure this matches your environment's mount path
6};
7
8export default nextConfig;
9// added by create cloudflare to enable calling `getCloudflareContext()` in `next dev`
10import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare";
11initOpenNextCloudflareForDev();

Mount path configuration

When you create an environment, you set a mount path, which is the subpath where your app will be accessible. For example, with a mount path of /app, your app lives at:

https://your-webflow-cloud-domain.com/app

In your framework configuration, make sure you set your app’s base path and asset prefix to the mount path of your environment. When building your app, use the provided BASE_URL and ASSETS_PREFIX environment variables to construct correct paths instead of hard-coding them.

BASE_URL

The BASE_URL variable represents the mount path of your environment. Combine this with your Webflow Cloud domain to create the URL where your application is accessible to users.

Use for:

  • Navigation links and client-side routing
  • Form actions and redirects
1// Access BASE_URL in Next.js
2import config from "../next.config";
3
4const baseUrl = config.basePath || '';
5
6// Navigation button
7<Link href={`${baseUrl}/`}>
8 <button>Back to Home</button>
9</Link>
10
11// API fetch
12const response = await fetch(`${baseUrl}/api/users`);

ASSETS_PREFIX

ASSETS_PREFIX is the URL for static assets and some direct API calls. The ASSETS_PREFIX URL points directly to the Worker handling your app.

Use for:

  • Referencing static assets (images, CSS, JavaScript files)
  • Uploading large files to your app
1// Access ASSETS_PREFIX in Next.js
2import config from "../next.config";
3
4const assetsPrefix = config.assetPrefix || config.basePath || '';
5
6// Reference an image asset
7<img src={`${assetsPrefix}/images/logo.png`} alt="Logo" />

Troubleshooting and common questions

Webflow Cloud manages this file to ensure compatibility and security.

If you’re migrating an existing project, follow the steps in the Bring your own app guide.