[Yandex Cloud documentation](../../../index.md) > [Yandex Cloud Backup](../../index.md) > [Step-by-step guides](../index.md) > Backups > Restoring an external VM or server from a backup

# Recovering an external VM or server from a backup


{% note info %}

You cannot restore a VM backup to a server or a server backup to a VM. However, you can restore an [external](../../concepts/vm-connection/external-resources.md) server backup to a [Yandex BareMetal server](../../concepts/vm-connection/baremetal.md).

{% endnote %}

To avoid errors when restoring from a backup, start by comparing the disks and partitions of the backup against those of the VM or server you are restoring to. For more information, see [Viewing the parameters of backup disks and partitions](../backup-vm/view-disk-layout.md).

To recover a VM or server located in your infrastructure or a third-party provider's infrastructure from a backup:

1. [Start the recovery process on the Yandex Cloud side](#initiate-recovery).
1. [Make sure you have network access on the resource side](#validate-access).

## Start the recovery process on the Yandex Cloud side {#initiate-recovery}

{% list tabs group=instructions %}

- Management console {#console}

  1. In the [management console](https://console.yandex.cloud), select the folder containing the backup.
  1. Navigate to **Cloud Backup**.
  1. In the left-hand panel, select ![backups](../../../_assets/console-icons/archive.svg) **Backups**.
  1. Depending on the type of resource you want to recover, open the **External virtual machines** or **External servers** tab.
  1. In the line with the backup you want to use to recover an external VM or server, click ![options](../../../_assets/console-icons/ellipsis.svg) and select ![image](../../../_assets/console-icons/clock-arrow-rotate-left.svg) **Restore VM**.
  1. In the **Restoring from a backup** window that opens, select the external resource the backup will be recovered to in the **Target resource** field.
  1. Click **Restore**.

- CLI {#cli}

  If you do not have the Yandex Cloud CLI yet, [install and initialize it](../../../cli/quickstart.md#install).

  The folder used by default is the one specified when [creating](../../../cli/operations/profile/profile-create.md) the CLI profile. To change the default folder, use the `yc config set folder-id <folder_ID>` command. You can also specify a different folder for any command using `--folder-name` or `--folder-id`. If you access a resource by its name, the search will be limited to the default folder. If you access a resource by its ID, the search will be global, i.e., through all folders based on access permissions.

  1. See the description of the CLI command to restore a [resource](../../concepts/index.md#protected-resources) from a backup:

      ```bash
      yc backup backups recover --help
      ```

  1. Get the ID of the backup:

      ```bash
      yc backup backups list
      ```
      
      Result:
      
      ```text
      +--------------------------------------+--------------------------------------+----------------------+--------------------------------------+----------------------+------+------------------+--------+---------------------+
      |                  ID                  |              ARCHIVE ID              | COMPUTE INSTANCE ID  |             RESOURCE ID              |      POLICY ID       | TYPE |      DISKS       |  SIZE  |     CREATED AT      |
      +--------------------------------------+--------------------------------------+----------------------+--------------------------------------+----------------------+------+------------------+--------+---------------------+
      | ab55286e-795f-44dc-90af-b718******** | ef3e8144-fb65-6a59-5ec1-3162******** | jklp0o9i8012******** | 2465BE59-5687-4539-9589-DF7E******** | abc7n3wln123******** | FULL | Disk 1 (15.0 GB) | 1.5 GB | 2023-07-07 16:00:15 |
      | cd50e147-7dfa-449f-816b-67f8******** | gh06b195-c095-1234-7809-0700******** | mnoa5s6d8345******** | 135C519D-B5A3-4781-8DFA-40B3******** | deflqbiwc456******** | FULL | Disk 1 (15.0 GB) | 1.6 GB | 2023-07-03 10:00:10 |
      +--------------------------------------+--------------------------------------+----------------------+--------------------------------------+----------------------+------+------------------+--------+---------------------+
      ```

  1. Get the ID of the resource to restore:

      ```bash
      yc backup vm list
      ```
      
      Result:
      
      ```text
      +----------------------+--------------------------------------+--------+---------+--------+-----------------+----------------+---------------------+---------------------+--------+---------------------+---------------------+-------------+
      |     INSTANCE ID      |             RESOURCE ID              | ONLINE | ENABLED | STATUS | STATUS PROGRESS | STATUS DETAILS |  LAST BACKUP TIME   |  NEXT BACKUP TIME   | ACTIVE |     CREATED AT      |     UPDATED AT      |    TYPE     |
      +----------------------+--------------------------------------+--------+---------+--------+-----------------+----------------+---------------------+---------------------+--------+---------------------+---------------------+-------------+
      | ly5mzirn6xhd******** | 4fc0d855-b76c-****-99a4-bf01******** | true   | true    | IDLE   |               0 |                |                     |                     | true   | 2026-04-29 05:45:34 | 2026-04-29 05:54:21 | BMS         |
      | epd930eo5156******** | 6c58577d-409d-****-bc10-f464******** | true   | true    | IDLE   |               0 |                |                     |                     | true   | 2026-04-29 08:46:47 | 2026-04-29 08:54:00 | COMPUTE     |
      | cdgd246kiae3******** | d1fdd342-0ea8-****-9906-fa6c******** | false  | true    | IDLE   |               0 |                | 2026-04-27 13:07:05 | 2026-04-27 13:07:05 | true   | 2026-04-24 14:23:06 | 2026-04-29 08:54:33 | EXTERNAL_VM |
      +----------------------+--------------------------------------+--------+---------+--------+-----------------+----------------+---------------------+---------------------+--------+---------------------+---------------------+-------------+
      ```

  1. Recover a VM or server from a backup:

      ```bash
      yc backup backups recover \
        --source-backup-id <backup_ID> \
        --destination-instance-id <external_resource_ID>
      ```

      Where:

      * `--source-backup-id`: ID of the backup to recover the VM or server from.
      * `--destination-instance-id`: ID of the VM or server to recover the backup to.

      For more information about this command, see the [CLI reference](../../../cli/cli-ref/backup/cli-ref/backup/recover.md).

- API {#api}

  Use the [startRecovery](../../backup/api-ref/Backup/startRecovery.md) REST API method for the [Backup](../../backup/api-ref/Backup/index.md) resource or the [BackupService/StartRecovery](../../backup/api-ref/grpc/Backup/startRecovery.md) gRPC API call.

{% endlist %}

This will start recovery of the external resource from a backup.

{% note info %}

If you are using [LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)) to manage the disk space of the protected resource, learn [how to restore](../../concepts/backup.md#lvm) resources with LVM in Cloud Backup.

{% endnote %}

## Make sure you have network access on the resource side {#validate-access}

To be recovered from Yandex Cloud Backup backups, external VMs and servers need to have internet access. During the process of recovering an external resource from a backup, it will be restarted and the `Recovery Bootable Media` tool will be started on it. Make sure your VM or server has internet access in this mode.

If necessary, configure network access in the `Recovery Bootable Media` tool. Proceed as follows:

* In the top menu, click **Tools** and, depending on the interface you are using, select `Configure network` or `Wi-Fi settings`.
* In the window that opens, configure the settings and make sure you have an internet connection.

#### Useful links {#see-also}

* [Connecting VMs and servers from outside Yandex Cloud to Cloud Backup](../../concepts/vm-connection/external-resources.md)
* [Connecting a VM or server from outside Yandex Cloud to Cloud Backup](connect.md)
* [Linking a resource to a backup policy](../policy-vm/attach-and-detach-vm.md)
* [Creating a backup of a resource](../backup-vm/create.md)