# How to Use Zero-Downtime Deployments (Release Mode) in xCloud

> Turn on Release mode for a Git site in xCloud: every deploy builds a new release beside the live one, switches in one step, and keeps older releases for a one-click rollback.

**Zero-downtime deployments** keep your site answering visitors while you deploy. In xCloud the feature is called **Release mode**. Each deploy builds a new release next to the live one, checks that it works, and only then switches traffic to it in one step. If the new release fails its check, visitors keep getting the old one. xCloud keeps your last releases, so you can roll back with one click.

Without Release mode, a Git deploy updates the live site in place. A Node.js app, for example, is stopped and started again, and visitors can get errors for a moment. In our tests, six apps (Laravel, PHP on OpenLiteSpeed, WordPress, Node.js, a Dockerfile app and a Flask app) were deployed 3 times and rolled back while serving traffic, with 0 failed requests; the same Node.js app deployed without Release mode returned 27 errors over 3 deploys.

## Who can use it

Release mode works on sites that deploy from a Git repository:

| Site | Server | Guide |
| --- | --- | --- |
| Laravel and custom PHP | nginx or OpenLiteSpeed | [Laravel and PHP sites](/docs/zero-downtime-deploys-for-laravel-and-php-sites/) |
| Node.js (SSR, hybrid or static) | nginx | [Node.js apps](/docs/zero-downtime-deploys-for-node-js-apps/) |
| WordPress from Git (classic or Bedrock) | nginx | [WordPress from Git](/docs/zero-downtime-deploys-for-wordpress-from-git/) |
| Container built from a Dockerfile or an app recipe | Docker server | [Docker container sites](/docs/zero-downtime-deploys-for-docker-container-sites/) |

To turn Release mode on or off, or to roll back, you need the **Manage deploy scripts** permission on the team. The team owner always has it. See [who can change a deploy script](/docs/team-roles-permissions-in-xcloud/#who-can-change-a-deploy-script).

## How a deploy works in Release mode

What happens on each deploy depends on the stack:

- **Laravel, custom PHP and WordPress:** xCloud checks out the new commit into a new release folder, links the shared files into it, and runs your deploy script there. It then checks that the new release answers a request without a server error. Only then does the site folder switch to the new release, in one step.
- **Node.js (SSR and hybrid) and container sites:** the new release starts on a second port next to the live one. xCloud runs a health check against it. When it passes, nginx sends new requests to the new release. The old process or container gets time to finish the requests it is serving, then it stops.
- **Node.js static builds:** the build goes into a new release folder, and the site switches to it in one step, as for PHP.

If any step fails before the switch, nothing changes for visitors. The deploy log ends with "The live release is unchanged."

## Step 1: Open the Release mode card

Open your site, click **Git** in the site menu, and scroll to the **Release mode** card at the bottom of **Git Settings**. The card explains: "Each deploy builds a new release next to the live one and switches to it in one step, so visitors never see a half-deployed site. The last releases are kept for a one-click rollback."

![The Release mode card in Site → Git with the switch Off](/_landing/docs/zero-downtime-deploys-with-release-mode-in-xcloud-image-1.png)

If the site cannot use Release mode, the card shows the reason under the description and the switch stays off. [Release mode messages and fixes](/docs/release-mode-messages-and-fixes/) lists each reason and what to do.

## Step 2: Turn Release mode on

Click the switch. The **Turn on release mode?** dialog explains what changes: "The site directory becomes a link to its live release, and .env (and storage for Laravel, uploads for WordPress) moves to a shared folder every release uses. The site stays online." Click **Turn on**.

![The Turn on release mode? dialog with the Turn on button](/_landing/docs/zero-downtime-deploys-with-release-mode-in-xcloud-image-2.png)

The card shows "Turning release mode on…" and then **Release mode is on.** Your current files become the first release, marked **Converted** and **Live**.

![Release mode is on, with the shared files and the first Converted release](/_landing/docs/zero-downtime-deploys-with-release-mode-in-xcloud-image-3.png)

## Step 3: Deploy as usual

Deploy the way you always do: **Deploy Now**, push to deploy, or the Public API. Every deploy now adds a new release to the card. You can follow each deploy on the **Deployments** page, as described in [How to view Git deployments](/docs/view-git-deployments-in-xcloud/).

## Choose Release mode when you create a Git site

You can also turn it on while creating the site. In **Add New Site** → **Deploy via Git** → **Native app**, choose **Laravel**, **PHP App** or **Node.js**, then turn on **Release mode (zero-downtime deploys)** under the domain and branch. The text under it reads: "Each deploy builds a new release and switches to it at once; you can roll back."

![The Release mode (zero-downtime deploys) switch in the Deploy via Git wizard](/_landing/docs/zero-downtime-deploys-with-release-mode-in-xcloud-image-4.png)

The site converts to Release mode after its first successful deploy. If that first deploy fails, the site shows a failed deploy and Release mode stays off. The option appears only for members who have the **Manage deploy scripts** permission, and only for site types and servers that support it. For the rest of the wizard, see [Deploy Git projects in one click](/docs/deploy-git-projects-in-one-click-with-xcloud/).

## The releases list

While Release mode is on, the card lists your recent releases with **Release**, **Commit**, **Deployed by**, **Duration**, **Result** and **Actions**. The release name is the UTC time it was built.

- **Result** is **Converted** (your files when Release mode was turned on), **Deployed**, **Rolled back** or **Failed** (shown in red; it never went live).
- The release visitors get now shows a green **Live** label.
- Older releases that went live and are still kept on the server show a **Rollback** button.

![The releases list with the newest release Live and Rollback on older ones](/_landing/docs/zero-downtime-deploys-with-release-mode-in-xcloud-image-5.png)

PHP, Node.js and WordPress sites keep 5 releases on the server. Container sites keep 3 release images. To go back to an older release, see [How to roll back a deployment](/docs/roll-back-a-deployment-in-xcloud/).

## Shared files and folders

Files that must stay the same across releases live in one shared place and are linked into every release. By default that is `.env` for every native site, plus `storage` for Laravel and the uploads folder for WordPress. You can add folders such as `public/uploads` on the card. See [Shared files and folders in Release mode](/docs/shared-files-and-folders-in-release-mode/).

## Workers restart on the new code

After each deploy and each rollback, xCloud restarts the background processes of the site so they run the live code:

- Laravel queue workers are asked to restart after their current job (`queue:restart`), and Horizon is asked to restart (`horizon:terminate`).
- The site's other running Supervisor programs are restarted. A program you paused stays paused.

If a restart fails, the release is still live and the deploy log says which process to restart by hand. See [Supervisor for process management](/docs/supervisor-for-process-management/) and [Set up Laravel Horizon](/docs/set-up-laravel-horizon/).

## Turn Release mode off

Click the switch on the card and confirm **Turn off**. The dialog warns: "The live release becomes the site directory again. The other releases are removed, so you can no longer roll back to them." The shared files move back into the site folder. You can turn Release mode on again later.

## Limits and what is not supported

- Release mode creates each release from Git itself. A site with a custom **Git Pull Script** is refused until you go back to the default script.
- Your deploy script runs inside the new release. It must not use the live site path or `git pull`; use `$PROJECT_DIR` for paths.
- The database is shared by all releases. A rollback does not undo database changes.
- You cannot change the domain of a site while Release mode is on.
- WordPress sites installed by xCloud (not from Git), Docker Compose sites that run the repository's own compose file, and container sites that publish more than one port are not supported.
- Each stack guide lists its own rules: [Laravel and PHP](/docs/zero-downtime-deploys-for-laravel-and-php-sites/), [Node.js](/docs/zero-downtime-deploys-for-node-js-apps/), [WordPress from Git](/docs/zero-downtime-deploys-for-wordpress-from-git/) and [Docker container sites](/docs/zero-downtime-deploys-for-docker-container-sites/).

## Frequently asked questions

### Which sites can use zero-downtime deployments?

Git-deployed Laravel and custom PHP sites on nginx or OpenLiteSpeed, Node.js sites on nginx, WordPress sites deployed from Git on nginx (classic or Bedrock layout, with WordPress core in the repository), and container sites built from a Dockerfile or an app recipe on a Docker server.

### Does my site go offline while Release mode is turned on?

No. The confirm dialog says it: the site stays online. The files the site runs from become the first release, marked Converted, and it stays Live until your next deploy.

### What happens when a deploy fails?

The new release never goes live. The release that was live keeps serving visitors, and the card shows a red Failed row. The reason is in the deployment log on the Deployments page.

### Can I turn Release mode off again?

Yes. Click the switch and confirm Turn off. The live release becomes the site directory again, and the other releases are removed, so you can no longer roll back to them.

## Related guides

- [How to roll back a deployment](/docs/roll-back-a-deployment-in-xcloud/)
- [Shared files and folders in Release mode](/docs/shared-files-and-folders-in-release-mode/)
- [Release mode messages and fixes](/docs/release-mode-messages-and-fixes/)
- [Manage Release mode with the Public API and MCP](/docs/manage-release-mode-with-public-api-and-mcp/)
- [Troubleshooting Git deployments](/docs/troubleshooting-git-deployments-stuck-failed-or-not-triggering/)

If you run into any issues with zero-downtime deployments, feel free to reach out to our [support team](/docs/access-built-in-support-portal-in-xcloud/).
