# Shared Files and Folders in Release Mode in xCloud

> Choose which files and folders every release shares when you use zero-downtime deployments in xCloud: the defaults per stack, adding public/uploads, removing a path and Reset to defaults.

With **Release mode** (zero-downtime deployments) on, every deploy in **[xCloud](/)** builds a new release folder from your repository. Files your app writes at runtime, such as uploads, logs or `.env`, must not be lost when the next release goes live. So they live in one shared place, and xCloud links them into every release.

This guide shows which paths are shared by default and how to add your own. For the basics, read [How to use zero-downtime deployments](/docs/zero-downtime-deploys-with-release-mode-in-xcloud/).

## The defaults

| Site | Shared by default |
| --- | --- |
| Laravel | `.env`, `storage` |
| Custom PHP | `.env` |
| Node.js | `.env` |
| WordPress from Git (classic) | `.env`, `wp-config.php`, `wp-content/uploads`, `wp-content/blogs.dir` |
| WordPress from Git (Bedrock) | `.env`, `web/app/uploads`, `web/app/blogs.dir` |
| Container (Dockerfile or app recipe) | none |

A default path that doesn't exist in your site is left out. For example, a PHP site without a `.env` file shows no shared path until you add one.

## Step 1: Add a path

Open the site, click **Git**, and find **Shared between releases** on the **Release mode** card. The section appears while Release mode is on. Paths are relative to the site folder.

1. Make sure the folder or file exists in the site. Create it first if needed (for example, upload one file so `public/uploads` exists).
2. Type the path, for example `public/uploads`, in the box.
3. Click **Add path**.

![public/uploads typed into the shared paths box, next to Add path](/_landing/docs/shared-files-and-folders-in-release-mode-image-1.png)

The card shows "Updating the shared paths…" and then **The shared paths are updated.** The path is moved from the live release into the shared place and linked back at once, and every later deploy links it too.

![The shared paths .env, storage and public/uploads after The shared paths are updated](/_landing/docs/shared-files-and-folders-in-release-mode-image-2.png)

## Rules for a shared path

A path is refused, with the reason on the card, when it:

- is absolute (starts with `/`), or contains `..`, `.` or an empty part;
- uses characters other than letters, numbers, dots, dashes and underscores;
- is `.git`, the site's web root, or a folder that holds the web root;
- is listed twice, or sits inside another shared path ("… is inside …, which is shared too. Share one of them.");
- does not exist in the site yet, or is a file tracked by Git.

A site can share up to 50 paths.

## Step 2: Remove a path

Click the **×** next to the path. The **Stop sharing …?** dialog explains: "Its current files are copied back into the live release. Releases deployed from now on keep their own copy." Click **Stop sharing**.

## Step 3: Reset to defaults

After you change the list, a **Reset to defaults** button appears. Click it to go back to the defaults for your site. The dialog **Reset the shared paths?** lists them ("The list goes back to the defaults for this site: …"). Click **Reset**.

## Container sites share nothing

Container sites built from a Dockerfile or an app recipe have no **Shared between releases** section. Each release's container reads the site's `.env` from its own folder. An attempt to add a path through the API is refused with "A container site shares no paths: each release's container reads the site's .env from its own folder."

![A container site with Release mode on and no shared paths section](/_landing/docs/shared-files-and-folders-in-release-mode-image-3.png)

## Shared files and rollbacks

A [rollback](/docs/roll-back-a-deployment-in-xcloud/) switches only the code. Shared files stay as they are, so uploads made after a deploy are still there after you roll back. When you turn Release mode off, every shared path moves back into the site folder as a normal file or folder.

You can also read and change the list with the Public API or MCP: see [Manage Release mode with the Public API and MCP](/docs/manage-release-mode-with-public-api-and-mcp/).

## Frequently asked questions

### Why does my uploaded file disappear after a deploy?

The folder it was saved in is not shared, so each new release starts with the copy from your repository. Add the folder, for example public/uploads, under Shared between releases. From then on every release uses the same files.

### Can a shared path be a single file?

Yes. A shared path can be a file, such as .env, or a folder, such as storage or public/uploads. It must already exist in the site and must not be a file tracked by Git.

### How many paths can I share?

Up to 50 per site.

## Related guides

- [How to use zero-downtime deployments (Release mode)](/docs/zero-downtime-deploys-with-release-mode-in-xcloud/)
- [Zero-downtime deployments for Laravel and PHP sites](/docs/zero-downtime-deploys-for-laravel-and-php-sites/)
- [Zero-downtime deployments for WordPress from Git](/docs/zero-downtime-deploys-for-wordpress-from-git/)
- [Release mode messages and fixes](/docs/release-mode-messages-and-fixes/)

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