Bring your own app

Deploy your own Next.js or Astro app on Webflow Cloud.

Webflow Cloud deploys your app using Cloudflare Workers on the Edge runtime, enabling fast, globally distributed hosting. Before deploying to Webflow Cloud, your project may require some configuration to ensure compatibility with the Edge environment.

In this guide, you’ll learn how to create projects and environments, configure your app for Webflow Cloud, and deploy your app to your Webflow site,

Get Started with Webflow Cloud

To familiarize yourself with Webflow Cloud, it’s recommended to create your first Webflow Cloud project from the Webflow CLI before configuring a custom project.

Get started with Webflow Cloud → .

Time Estimate: 30 minutes

Prerequisites:

  • A Webflow account
  • A Webflow site with components
  • A GitHub account
  • One of the following:
    • An Astro project
    • A Next.js project (version 15 or higher)
  • Node.js 20.0.0 or higher
  • A package manager of your choice (npm, yarn, or pnpm)
Webflow Cloud is currently in beta

Webflow Cloud is currently in beta. Please see webflow.com/cloud for access.

1. Create a new Webflow Cloud project

Connect GitHub to Webflow Cloud, create a project, and configure an environment for automated deployments.

Webflow Cloud project creation
1

Open Webflow Cloud

In Webflow, navigate to your site’s settings and select “Webflow Cloud” from the sidebar.

2

Authenticate with Github

Click the “Login to GitHub” button to connect your GitHub account. Then click the “Install GitHub” button. Follow the instructions to allow Webflow Cloud to access your GitHub repositories.

3

Create a new Webflow Cloud project

Click “Create New Project”

4

Add project details

  • Choose a name for your Webflow Cloud project
  • Select your newly created GitHub repository
  • Optionally, enter a description for your app
  • Choose a branch to deploy your project from
  • Choose a mount path for your project (for example, /app → mysite.webflow.io/app)
  • Click “Create Project” to save your project
5

Publish your Webflow Site

To make your new project and environment live, you’ll need to publish your Webflow site. Click the “Publish” button in the top right corner of your Webflow Dashboard.

2. Configure your project for Webflow Cloud

Webflow Cloud leverages Cloudflare Workers on the Edge runtime to deploy your applications. The Edge runtime environment differs from traditional Node.js servers, requiring specific configurations for compatibility.

The following steps outline common migration patterns to help you adapt your application for Webflow Cloud. Note that depending on your application’s specific requirements, you may need to make additional adjustments beyond these configurations.

Webflow Cloud is compatible with Next.js 15 and higher

Webflow Cloud is compatible with Next.js 15 and higher. If you’re using a version of Next.js lower than 15, please upgrade to the latest version.

1

Configure your base path

In Webflow Cloud, your application is served from the mount path you configured in your environment settings. For example, if your mount path is /app, your application will be accessible at yourdomain.webflow.io/app. To ensure proper routing and asset loading, you must configure the basePath property in your next.config.ts file to match this mount path exactly.

next.config.ts
1module.exports = {
2 // Configure the base path to reflect the mount path of your environment
3 // For example, if your app is mounted at /app, set basePath to '/app'
4 basePath: '/app',
5
6 // Additional Next.js configuration options can be added here
7 // For example:
8 // output: 'standalone',
9 // reactStrictMode: true,
10}
2

Install and configure OpenNext

OpenNext is an adapter designed specifically for deploying Next.js applications to cloud environments like Webflow Cloud. By using OpenNext, you can deploy your Next.js app without managing complex infrastructure configurations yourself.

  1. Install OpenNext
    In your terminal, navigate to your project and run the following command to install OpenNext:

    $npm install @opennextjs/cloudflare@1.0.0-beta.4
  2. Configure OpenNext
    Create a new configuration file named open-next.config.ts in your project’s root directory. This file configures OpenNext to work with Webflow Cloud’s deployment environment.

    open-next.config.ts
    1import type { NextConfig } from "next";
    2
    3import { defineCloudflareConfig } from "@opennextjs/cloudflare";
    4
    5export default defineCloudflareConfig({
    6});
3

Set up local testing for Webflow Cloud

Webflow Cloud uses Wrangler - Cloudflare’s CLI tool - to bridge the gap between local development and cloud deployment. By integrating Wrangler into your workflow, you can identify and resolve compatibility issues early, significantly reducing debugging time after deployment.

  1. Install Wrangler
    To get started, install and configure Wrangler as a dev dependency in your project.

    $npm install wrangler --save-dev
  2. Set up your Wrangler configuration
    Create a wrangler.jsonc file in your project root that defines how your application will run in both development and production.

    wrangler.jsonc
    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 /** Rest of Code **/
    17}

    See the Cloudflare documentation for more details on how to configure Wrangler.

  3. Create a Cloudflare environment file
    Create a new file named cloudflare-env.d.ts in your project’s root directory. This file will allow you to use environment variables defined in your Webflow Cloud environment.

    cloudflare-env.d.ts
    1interface CloudflareEnv {
    2}
  4. Add the development preview command
    Add this script to your package.json file to enable local testing with Wrangler. This command builds your Next.js app and immediately serves it using the Edge runtime, giving you an exact preview of how your app will perform in production on Webflow Cloud:

    package.json
    1"scripts": {
    2 // Existing scripts...
    3 "preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview", //
    4}
4

Define your Webflow Cloud framework configuration

Create a webflow.json file at the root of your project to inform Webflow Cloud about your app’s framework.

webflow.json
1{
2 "cloud": {
3 "framework": "nextjs"
4 }
5}

3. Manage assets and APIs

1

Asset references

When deployed to Webflow Cloud, all your static assets must include the configured mount path to load correctly. Without this path prefix, browsers will request assets from the root domain, resulting in 404 errors. Implement this pattern in your components for reliable asset loading:

components/Logo.tsx
1import config from "../next.config";
2import Image from "next/image";
3
4// Get the base path from config
5const basePath = config.basePath || '';
6
7export function Logo() {
8return (
9 <Image
10 src={`${basePath}/images/logo.png`} // Add base path to asset path
11 alt="Logo"
12 width={180}
13 height={40}
14 priority
15 />
16);
17}
2

APIs

When using Next.js with a configured base path, there’s an important distinction between API route definitions and client-side requests:

  1. Server-side API route handlers are automatically mounted at your base path by Next.js. To ensure your API routes run on the Edge runtime, add the export const runtime = 'edge'; directive to your API route.
  2. Client-side fetch calls must manually include the base path to correctly reach your endpoints

Without these adjustments, your API routes will not build properly and your client-side fetch calls will fail by targeting the wrong URL. Implement these patterns in all your APIs and client-side data fetching functions:

1// /src/pages/api/data.ts
2import { NextRequest, NextResponse } from 'next/server';
3
4export async function GET(request: NextRequest) {
5 return NextResponse.json({ message: 'Hello, world!' });
6}
7
8export const runtime = 'edge'; // Add this line to your API route
Edge Runtime: Use `fetch` API

The Edge runtime has limited API support. Stick to fetch for API calls and avoid third-party clients like axios which may not be compatible.

5. Configure environment variables

1

Access environment variable settings

In Webflow Cloud, navigate to your project’s environment settings:

  • Click your project name in the dashboard
  • Select the specific environment you want to configure
  • Click the “Environment Variables” tab
2

Add and configure environment variables

Add each environment variable that your application requires:

  • Click “Add Variable”
  • Enter a descriptive “Variable Name” (e.g., DATABASE_URL, API_KEY)
  • Enter the corresponding “Variable Value”
  • Toggle “Secret” for sensitive values that should be encrypted (API keys, tokens, etc.)
  • Click “Add Variable” to save

Repeat this process for all required variables.

Environment variables are only available at runtime

Environment variables in Webflow Cloud are injected at runtime only and are not accessible during the build process. Keep the following in mind to avoid build failures:

  • Do not include environment variable validation or required checks that run during build time
  • Use conditional logic to handle cases where environment variables might be undefined during builds
3

Access environment variables in your code

Your environment variables will be available in your code through:

1// In Next.js
2process.env.VARIABLE_NAME

6. Deploy your project

After configuring your project:

  1. Test your app in the local preview environment
    Use the local preview environment with Wrangler to simulate the same base path configuration as your production environment.

    $npm run preview
  2. Commit your changes
    In your terminal, commit your changes to your GitHub repository using the following commands. Once your GitHub branch is updated, Webflow Cloud will automatically deploy your project to the new environment.

    $git add .
    >git commit -m "Deploying to Webflow Cloud"
    >git push
    Your deployment may take up to 5 minutes to complete

    View your deployment in the “Environment Details” dashboard. Review the status of your deployment by viewing the build logs.

  3. View your app at your site’s URL + mount path
    Once your app has been successfully deployed, navigate to your site’s domain and mount path to see your newly deployed Webflow Cloud app!

🎉Congratulations!
You’ve successfully deployed your app on Webflow Cloud.

Next steps

Now that you’ve successfully deployed your app on Webflow Cloud, here’s what you can do next.

Troubleshooting

After creating a new environment, you’ll need to publish your Webflow site to make your environment live.

The Webflow Cloud Github App may not have access to your repository. To check, go to the Webflow Cloud tab in your Webflow site settings and click “Install Github App”. Follow the prompts on Github to ensure Webflow has access to read from your repository. Once you grant access, try committing to the branch that Webflow Cloud should be monitoring for deployments in your app.

Check that you’re correctly using the base path in all asset and API references. Look for fixed paths that might be missing the base path prefix.

Verify that your callback URLs include the correct base path and that you’re not duplicating the base path in your code references.

Check your project’s build logs in the Webflow Cloud dashboard. Common issues include:

  • Incompatible Node.js version
  • Environment variables not configured correctly
  • Missing or incorrect framework configuration in the following files:
    • webflow.json
    • next.config.js or Astro.config.js
    • wrangler.jsonc
    • cloudflare-env.d.ts or worker-configuration.d.ts
  • Custom build commands not supported (Webflow Cloud only uses Astro build or next build)
Built with