In this guide, you’ll use the Webflow CLI to create an Astro or Next.js app, sync a Webflow site’s design system with DevLink, and deploy the app to Webflow Cloud. Use this workflow when you want to scaffold locally and work with exported Webflow styles, variables, and components. If you already have a Next.js or Astro app, see Bring your own app.
Time Estimate: 30 minutes
Prerequisites:
npm installedIn your terminal, run the following command to install the CLI globally:
You can run the command webflow --version to verify that the CLI installed successfully.
Create a Webflow site by cloning the Astral Fund template. This site is pre-configured with styles, variables, and components optimized for Webflow Cloud and DevLink.
The template site looks like this:

In these steps, you use the Webflow CLI to create an Astro or Next.js application. The CLI generates an app scaffold that’s synced with your Webflow site’s design system through DevLink.
The following steps walk you through this CLI setup:

Start creating the app by running this command:
At the Where do you want to deploy this app? prompt, select Existing site.
The default option is New domain, which creates a standalone app that is not attached to any Webflow site. For this guide, choose Existing site so the app can use components from the site you cloned in the previous step.
At the Which framework would you like to use? prompt, select astro or nextjs.
At the What would you like to name your app? prompt, enter a name such as my-webflow-cloud-app.
At the What path do you want to use locally? prompt, enter the mount path for the application (default: /app).
For example, if you specify the mount path /app, Webflow Cloud hosts the application at mysite.webflow.io/app, where mysite.webflow.io is the URL of the Webflow site.
If you are not already authenticated, the CLI opens a browser window for you to log in to Webflow. After you grant access, return to your terminal.
At the Search for a Webflow site: prompt, search for and select the template site that you cloned in the previous section. The CLI then scaffolds the app and syncs the site’s components into it via DevLink.
If your workspace has only one Webflow site, the CLI skips this prompt and uses that site automatically.
Push the app to a GitHub repository. For more information, see Adding locally hosted code to GitHub.
You can skip all prompts by passing the required flags up front. See the webflow cloud init reference for the full list of options.
In the next section, you add the application as a Webflow Cloud app as part of the site.
Webflow Cloud apps can be part of a site or independent apps in your Workspace. Because this application contains components from the site you created, these steps cover creating an app as part of the site. Then, you configure the app to deploy updates automatically.

In Webflow, navigate to your site’s settings and select Webflow Cloud from the sidebar.
If Webflow is not yet connected to your GitHub account, click Login to GitHub to connect your GitHub account and then click Install GitHub app. Follow the instructions to enable Webflow Cloud to access your GitHub repositories.
Click New project > Create app.
Expand Import a GitHub repository and select your GitHub organization and repository.
Specify a name for the Webflow Cloud app, the branch to deploy, and the path to deploy the application to. You can deploy other branches to other paths later, such as if you want to have separate staging and production environments.
Click Deploy and wait for Webflow to import the repository and set up the Webflow Cloud app.
The new app appears in the Webflow Cloud section of the site’s settings, as in this example:

The app also has an environment that is based on the branch and path that you specified when you created the app. To see it, click the app’s name in the Name column. The environment looks like this, showing the name of the environment and the history of builds and deployments:

If you have not published the site yet, publish it now by going to the General settings page and clicking Publish.
View the deployed app by opening its environment in the Webflow Cloud settings and clicking its link under Environment URL. Note that the URL includes the deployment path.
Now the application is deployed and updates automatically when you update the repository.
Deployments may take up to 2 minutes to complete. You can view the status of deployments and build logs on the environment page.
The webflow cloud init command added several things to the application in the /webflow folder via DevLink, including:
For more information on what DevLink exports from sites into applications, see What’s exported.
To use these exported styles and components, you must import them in the app by adding the DevLinkProvider component to manage Webflow interactions in your app’s layout files.
The webflow cloud init command automatically added this component to the application, as in these examples:
If you created a Next.js app, the src/app/layout.tsx file wraps the content of the application in the DevLinkProvider component, as in this example:
Follow the steps for your application platform:
Run the following commands in your terminal:
npm package manager.In the pages directory, update index.astro to include the Navbar and Footer components from the webflow folder in the root of your app.
This example imports the components and includes them within the page structure:
You may need to add the @webflow alias to the tsconfig.json file as in this example:
Then, add the alias to the astro.config.mjs file as in this example:
Add the client:load directive to each component to indicate that Astro should load this component on the page.
Now you can create components in the Webflow site, export them, and use them in the application.
Now that you’ve successfully created and deployed a Webflow Cloud app, here’s what you can do next.
Learn about configuration options to work seamlessly with Webflow Cloud, and add advanced functionality to your new app.
Learn how to manage environments for different stages of development.
Explore deployment options and Webflow Cloud’s CI/CD integration with GitHub to streamline your release process.
Add a SQLite database to your app to store and retrieve user data.
If you’re not sure why your build failed, or why there is an error in the CLI, see the log for detailed resolution information. Some common failure points include:
If you have never published your site before, publish it now. If you don’t see the app, check your mount path, confirm that the environment exists, and verify that the latest deployment succeeded.
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 make sure Webflow has access to read from your repository. After you grant access, try committing to the branch that Webflow Cloud should be monitoring for deployments in your app.
If the app references assets, you must reference the mount path of your app (such as /app → mysite.webflow.io/app) to serve them correctly.
You can change the directory that components are exported into with the rootDir option in webflow.json.
For other configuration options, see Configuration options.