[Yandex Cloud documentation](../../../index.md) > [Yandex Cloud Backup](../../index.md) > [Step-by-step guides](../index.md) > Backups > Deleting a backup

# Delete backup


{% note info %}

To delete backups, make sure the folder contains at least one VM or BareMetal server connected to Cloud Backup. If there are no such VMs or servers, temporarily [create](../create-vm.md) a new VM with a connection to Cloud Backup and delete the backups.

The deletion process is asynchronous, so wait until it is over. Before stopping or removing the last VM or server connected to Cloud Backup, make sure the the backup list is empty.

{% endnote %}

To delete a backup:

{% 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 resource you want to delete the backup for, select the **Virtual machines** or **BareMetal servers** tab.
  1. Click ![image](../../../_assets/console-icons/ellipsis.svg) in the row with the backup you need to delete and select ![trash-bin](../../../_assets/console-icons/trash-bin.svg) **Delete**.
  1. Confirm the deletion.

- 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. View a description of the CLI delete backup command:

      ```bash
      yc backup backups delete --help
      ```

  1. Get the ID of the backup to delete:

      ```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 VM whose backup you need to delete:

      ```bash
      yc compute instance list
      ```
      
      Result:
      
      ```text
      +----------------------+---------+---------------+---------+--------------+-------------+
      |          ID          |  NAME   |    ZONE ID    | STATUS  | EXTERNAL IP  | INTERNAL IP |
      +----------------------+---------+---------------+---------+--------------+-------------+
      | jklp0o9i8012******** | my-vm-1 | ru-central1-b | RUNNING | 51.250.**.** | 192.168.*.* |
      | mnoa5s6d8345******** | my-vm-2 | ru-central1-b | RUNNING | 84.201.**.** | 192.168.*.* |
      +----------------------+---------+---------------+---------+--------------+-------------+
      ```

      To get the BareMetal server IDs, select **BareMetal** from the list of services of the relevant [folder](../../../resource-manager/concepts/resources-hierarchy.md#folder) in the [management console](https://console.yandex.cloud). The IDs are specified in the server list in the **ID** field.

  1. Delete the backup:

      ```bash
      yc backup backups delete \
        --backup-id <backup_ID> \
        --instance-id <VM_or_BareMetal_server_ID>
      ```

      Where:

      * `--backup-id`: ID of the backup to delete.
      * `--instance-id`: ID of the VM or BareMetal server whose backup you need to delete.

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

- API {#api}

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

{% endlist %}

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

* [Deleting all backups of a VM or BareMetal server](batch-delete.md)