# How to Backup And Restore Docker Apps in xCloud

> Back up and restore Docker apps in xCloud: where app data lives, on-demand and scheduled snapshots, S3-compatible or SFTP destinations and in-place restores.

**Backup and restore docker apps** in xCloud protects the app’s persistent data and deployment recipe. xCloud captures named volumes, eligible bind mounts, `docker-compose.yml` and the app’s `.env` file in an encrypted, deduplicated restic snapshot.

This guide is for site owners and team members who manage Docker app sites and need on-demand backups, scheduled backups, remote copies, retention controls or an in-place restore.

Need a server for your containers? See [container hosting on xCloud](/docker-hosting/) for server sizes and prices.

## Where your Docker app's data lives

A Docker app keeps its files in four places, and the backup treats each one differently. Knowing which is which explains why SFTP shows less than you expect and what a backup brings back.

| What | Where it lives | Can the site's SFTP user see it? | In an xCloud Docker backup? |
|---|---|---|---|
| App data: databases, uploads, settings the app saves | **Docker named volumes**, in Docker's own storage on the server (`/var/lib/docker/volumes/`) | No | Yes |
| The app's recipe: `docker-compose.yml` and `.env` | The site folder, `/var/www/<site>/` | Yes | Yes (for apps deployed from Git, files the repository tracks are left to Git) |
| Folders you mount yourself (bind mounts) | Wherever the compose file points | Only if they are inside the site folder | Yes, except server system folders such as `/etc` or `/var/lib/docker` |
| The app's code, built-in themes and default files | **Inside the container image** | No | No. The image is pulled again from its registry |

### Why SFTP can't see the data

Each site's SFTP and SSH user can only read that site's folder. Docker volumes sit in Docker's storage, which only the server's administrator account can read. That is why you can connect with the site's SFTP details and find the compose file but no database or uploads. Nothing is missing: the data is in the volumes.

To look at the volumes, connect to the server over SSH as a [sudo user](/docs/usudo-users-and-site-users-in-xcloud/) and run:

```bash
sudo docker volume ls
sudo docker volume inspect VOLUME_NAME
```

`inspect` shows the volume's **Mountpoint**, the folder on the server that holds its files. Don't move or edit files there while the app is running. To keep a copy you can restore, use the backups in this guide.

### Changing files that come with the image

Files baked into the image, such as an app's built-in themes or code, are not on the server as normal files. If you change them inside a running container, the change is lost the next time xCloud recreates the container, for example after **Update** or **Save & Redeploy**. Backups don't keep those changes either.

To customise them in a way that lasts, use one of these:

- **Build your own image** with your changes, push it to a container registry, and point the service's `image:` line at it on the app's **Compose** page (**Docker Compose** for apps you deployed with your own compose file). See [update a One Click app and edit its Docker Compose file](/docs/update-a-one-click-app-and-edit-its-docker-compose-in-xcloud/).
- **Mount a folder** from the site folder into the container (a bind mount) for files the app reads while it runs. Files in a bind mount inside the site folder are included in Docker backups. Apps that compile their themes when the image is built need the first option instead.

## **How to Backup and Restore Docker Apps in xCloud?**

With a dedicated backup and restore experience, xCloud makes protecting Docker applications simpler and more reliable. Whether applications are created with OneClick, Docker Compose, Git or Dockerfiles, users can schedule backups, control retention, choose flexible storage options and preview backups before restoring them.

### **Open the Docker Backups Page**

In the xCloud dashboard, open **Sites** and select your Docker site. Then from the site menu select **Backup**, then **Previous Backups**. Review the backup summary and existing backup rows.

![Previous Backups selected under Backup in the Docker site menu, showing the Backup Status Overview](/_landing/docs/backup-and-restore-docker-apps-previous-backups.png)

The summary shows whether automatic backups are active, the configured frequency, the retention period and the latest backup. Each backup row shows its time, type, snapshot identifier and status.

### **Create an On-demand Backup**

On **Backup > Previous Backups**, select **Backup Now**. Wait while xCloud creates the backup asynchronously. Refresh or revisit the list to confirm the row changes from **Running** to **Completed**.

![Click 'Backup Now' on the Local Backup tab of Backup > Previous Backups](/_landing/docs/backup-and-restore-docker-apps-backup-now.png)

During capture, xCloud stops the app, records its eligible named volumes and bind mounts, saves the Compose recipe and environment file and restarts the app. A remote destination receives a replicated copy after the local capture finishes.

### **Configure Scheduled Local Backups**

Open **Backup > Backup Settings**. Select the **Local Backup** tab. Turn on **Automatic Backup**. Under **Select Backup Frequency**, choose how often to back up. To remove older snapshots automatically, turn on **Backup Retention** and pick a period (see [Choose a retention period](#choose-a-retention-period)). Select **Save Settings**.

![Backup Settings Local Backup tab with Automatic Backup, Select Backup Frequency and the Delete backups older than retention presets](/_landing/docs/backup-and-restore-docker-apps-local-backup-settings.png)

### Choose a retention period

Docker backups can run **Every 12 Hours**, **Daily**, **Weekly** or **Monthly**, on the local destination and on each remote destination separately.

Under **Backup Retention**, pick how long to keep snapshots in **Delete backups older than**: 3 days, 1 week, 2 weeks, 30 days, 2 months, 3 months, 6 months or 1 year. Select **Custom** to enter any number of days up to 3650.

Retention always keeps the newest snapshot, even when it is older than the selected period, so the last good backup survives if scheduled backups stop.

### **Configure Remote Backups**

Remote backups keep a copy outside the site’s server. Docker app backups go to **S3-compatible storage** (such as [Amazon S3](/docs/aws-s3-bucket-for-site-backup-in-xcloud/) or [Cloudflare R2](/docs/cloudflare-r2-storage-for-site-backup/)) or an [SFTP server](/docs/integrate-sftp-storage-provider-with-xcloud/). Google Drive and pCloud are not available for Docker apps, so they don't appear in the storage provider list on this page, even when your team has connected them for other sites.

Configure an S3-compatible or SFTP provider for your team if one is not already available. Open the Docker site and go to **Backup > Backup Settings**. Select the **Remote Backup** tab. Under **Bucket**, choose **Select Storage Provider** and select the destination. Configure **Automatic Backup**, **Backup Frequency** and **Backup Retention** as needed. Select **Save Settings**.

![Configure Remote Backups](/_landing/docs/backup-and-restore-docker-apps-image-3.png)

### Add a second remote destination

A Docker site can replicate to **up to two remote destinations**, each with its own frequency and retention. Each saved destination appears as a pill on the **Remote Backup** tab, with a counter of how many of the two you use. To add the second one, select **Add another destination**, choose a different storage provider and select **Save Settings**.

![The Docker Backup Settings Remote Backup tab with two destination pills, site-backups-primary every 12 hours and site-backups-offsite weekly, and the 2 of 2 remote destinations counter highlighted](/_landing/docs/backup-and-restore-docker-apps-remote-destinations.png)

The storage provider of a saved destination cannot be changed. To move backups to another provider, add it as a new destination. Two destinations cannot use the same bucket.

On **Backup > Previous Backups**, the **Remote Backup** tab shows one pill per destination. The status overview, the backup list and **Backup Now** all follow the selected destination, so a manual backup is replicated to that destination only.

![The Docker Previous Backups page on the Remote Backup tab, with one pill per remote destination highlighted](/_landing/docs/backup-and-restore-docker-apps-remote-backups-list.png)

### **Restore a Docker App Backup**

A restore replaces the current app data in place, in the same Docker site the backup came from, so that site must still exist. Before you delete a Docker site or its server, read [backups and the site lifecycle](/docs/backups-and-the-site-lifecycle-in-xcloud/). Confirm that you selected the correct site and snapshot before applying a restore.

Open **Backup > Previous Backups**. Find a backup with **Completed** status. Open the row’s three-dot **Action** menu and select **Restore**.

![Completed Docker backup action menu with Restore highlighted](/_landing/docs/backup-and-restore-docker-apps-docker-backup-restore-action.png)

Review the prepared restore details. xCloud checks that the snapshot is reachable and previews its size and paths without changing the app. Enter the site name when prompted to confirm the destructive operation. Apply the restore and wait for the operation to finish.

### **Delete A Backup**

Open the three-dot **Action** menu for a backup that is not running. Select **Delete** and confirm the action.

![Delete A Backup](/_landing/docs/backup-and-restore-docker-apps-image-4.png)

## **Frequently Asked Questions**

### How many remote backup destinations can a Docker app have?

Up to two, each with its own frequency and retention. Local backups on the server are set up separately on the Local Backup tab.

### Can I change the storage provider of a saved remote destination?

No. To move backups to another provider, add it as a new destination. Two destinations cannot use the same bucket.

### Why can't I see my Docker app's data over SFTP?

The app's data is kept in Docker volumes in Docker's own storage on the server, outside the site folder. The site's SFTP or SSH user can't read that storage. Connect to the server as a sudo user to inspect it, and use Docker app backups to keep a copy.

### Can I back up a Docker app to Google Drive or pCloud?

No. Docker app backups go to S3-compatible storage or SFTP only. Google Drive and pCloud destinations are not available for Docker apps.

### Does Backup Retention delete my only Docker backup?

No. Retention always keeps the newest snapshot, even when it is older than the selected period, so the last good backup survives if scheduled backups stop.

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