> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Build and Deploy with the CLI

## Article: Build and Deploy with the CLI

## Article Link: https://dev.wix.com/docs/go-headless/wix-managed-headless/other-frameworks/build-and-deploy-with-the-cli.md

## Article Content:

# Build and Deploy with the CLI

After developing and testing your project locally, you can take it to production. This article guides you through that process for a Wix-managed headless project built with a framework other than Astro.

> **Using Astro?** Wix builds Astro projects for you, so the flow starts with `wix build`. See [Build and Deploy with the CLI](https://dev.wix.com/docs/go-headless/wix-managed-headless/full-integration-astro/development/build-and-deploy-with-the-cli.md) for the full integration instead.

To create a project in the first place, see [Deploy Your Own Frontend with the CLI](https://dev.wix.com/docs/go-headless/wix-managed-headless/other-frameworks/your-own-frontend/deploy-your-own-frontend-with-the-cli.md).

## Before you begin

Make sure that you have:

- [Node.js](https://nodejs.org/en/) (v20.11.0 or higher).
- A project already linked to Wix, meaning it contains a [`wix.config.json` file](https://dev.wix.com/docs/go-headless/wix-managed-headless/other-frameworks/the-wix-config-json-file.md).

## Step 1 | Build the project yourself

Wix doesn't build projects that aren't built with Astro, so build locally with your framework's own tooling.

Make sure that `outputDirectory` in `wix.config.json` points at the folder your framework actually builds to. It defaults to `./dist`. To deploy server code alongside your client files, set `outputDirectory` to an object with separate `client` and `server` paths.

> **Note**: Wix runs server files as long as they're built for the Cloudflare Workers runtime.

## Step 2 (Optional) | Create a preview URL

A preview URL is a link you can share with team members that allows them to preview and test your project. Each preview URL directs to a unique version of your project hosted on Wix's servers. Subsequent updates to your project won't affect any previously created versions.

To push your build output to Wix's servers and create a preview URL, run the [preview](https://dev.wix.com/docs/wix-cli/command-reference/project-commands/preview.md) command:

```bash
npx wix preview
```

## Step 3 | Release your project

To push your project to Wix's servers and publish it, run the [release](https://dev.wix.com/docs/wix-cli/command-reference/project-commands/release.md) command and follow the prompts:

```bash
npx wix release
```

After releasing your project, the CLI provides the URL of your published site, along with preview URLs for your project and dashboard.

<blockquote class="tip">

__Tip:__
Releasing also clears your entire site cache, so visitors get the latest version. If you've deployed an update but still see outdated content, run `npx wix release` again to clear the cache.

</blockquote>

## Next steps

You now have a fully working project. Use the following resources to continue building it:

+ [Set up authentication](https://dev.wix.com/docs/go-headless/authentication/setup/create-an-sdk-client-with-oauth.md)
+ [Develop Your Project](https://dev.wix.com/docs/go-headless/wix-managed-headless/develop-your-project.md)