Connecting a VM or server from outside Yandex Cloud to Cloud Backup
With Yandex Cloud Backup, you can back up and recover virtual machines and servers located within your own infrastructure or that of a third-party provider.
To connect an external VM or server to Cloud Backup, the resource must be running one of the supported operating systems.
For the proper Cloud Backup agent operation, the VM must meet the minimum requirements.
To connect an external VM or server running a Linux Ubuntu OS to Cloud Backup:
-
In the management console
, select the folder where you want to connect your external resource to Cloud Backup. -
Navigate to Cloud Backup.
-
In the left-hand panel, select
Connected resources. -
In the top-right corner, click
Connect external resource. -
In the Connect external resource window that opens:
- In the Resource type field, select the type of the external resource you want to connect: External virtual machine or External server.
- In the Backup policies field, select one or more backup policies to automatically apply to the external resource after installing the agent. You can also associate these policies later.
- Under Command to install the Cloud Backup agent, copy the command for installing the Cloud Backup agent on an external resource.
-
Connect to the external VM or server and run the command you copied with administrator privileges.
Result:
... Fetched instance id from file: cdgd246kiae3******** fetched registration token: 802C-AE... installing agent with rain https://ru01-cloud.cyberprotect.ru (log: /var/log/baas-agent-installer/log.txt) Trying to register agent using RegisterAgent... Agent registered with id E6B1A5DC-ECE0-****-A9B8-AFD2******** -
Make sure the external resource is connected to Cloud Backup. To do this, on the
Connected resources page, open the External virtual machines or External servers tab, depending on your resource type. The list should include the resource you connected.
-
Install and initialize the Yandex Cloud CLI.
You can install the Yandex Cloud CLI either directly on your target VM or server or on any other machine.
The folder used by default is the one specified when creating 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-nameor--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. -
Get the script code for installing the Cloud Backup agent on an external resource. The exact command depends on the type of resource you want to connect:
VMServeryc backup agent install-external vmResult:
sudo apt-get update && sudo apt-get install -y jq gawk curl && curl https://storage.yandexcloud.net/backup-distributions/agent_installer_external_vm.sh | sudo bash -s -- --instance-registration-token="13d1d696-0ea4-****-93a9-f8c5********"yc backup agent install-external serverResult:
sudo apt-get update && sudo apt-get install -y jq gawk curl && curl https://storage.yandexcloud.net/backup-distributions/agent_installer_external_server.sh | sudo bash -s -- --instance-registration-token="ed6991f2-f364-****-a08e-75a7********" -
Run the bash script you got in the previous step:
VMServersudo apt-get update && \ sudo apt-get install -y jq gawk curl && \ curl https://storage.yandexcloud.net/backup-distributions/agent_installer_external_vm.sh | sudo bash -s -- --instance-registration-token="13d1d696-0ea4-****-93a9-f8c5********"sudo apt-get update && \ sudo apt-get install -y jq gawk curl && \ curl https://storage.yandexcloud.net/backup-distributions/agent_installer_external_server.sh | sudo bash -s -- --instance-registration-token="ed6991f2-f364-****-a08e-75a7********"Result:
... Fetched instance id from file: cdgd246kiae3******** fetched registration token: 802C-AE... installing agent with rain https://ru01-cloud.cyberprotect.ru (log: /var/log/baas-agent-installer/log.txt) Trying to register agent using RegisterAgent... Agent registered with id E6B1A5DC-ECE0-****-A9B8-AFD2********Your external resource is now connected to Cloud Backup and has an ID. In the above example, this is
cdgd246kiae3********. -
Make sure the external resource is connected to Cloud Backup by specifying the ID you got in the previous step:
yc backup vm get <external_resource_ID_in_Cloud_Backup>Result:
compute_instance_id: cdgd246kiae3******** created_at: "2026-04-24T14:23:06.382900082Z" updated_at: "2026-04-29T19:48:22.013489248Z" enabled: true status: IDLE last_backup_time: "2026-04-27T13:07:05Z" next_backup_time: "2026-04-29T21:00:00Z" resource_id: d1fdd342-0ea8-****-9906-fa6c******** is_active: true init_status: REGISTRED metadata: "null" type: EXTERNAL_VM agent_info: current_version: 18.0.38811
- Get the command for installing the Cloud Backup agent on an external resource. To do this, use the getAgentInstallCommand REST API method for the Setup resource or the SetupService/GetAgentInstallCommand gRPC API call. In the request parameters, specify the target resource type:
EXTERNAL_VMorEXTERNAL_SERVER. - Connect to the external VM or server and run the command with administrator privileges.
- Once the agent is installed, the external resource is automatically registered in Cloud Backup. To get a list of connected resources, use the list REST API method for the Resource resource or the ResourceService/List gRPC API call.
To back up and restore your connected external resource using Cloud Backup, associate that resource with a backup policy. For more information, see Linking a resource to a backup policy.