You can install the CloudRay gent on DigitalOcean Droplets using:

  • Option 1: Automatic installation during Droplet creation using User Data
  • Option 2: Manual installation on existing Droplets

The CloudRay Agent establishes a secure, persistent connection between your Droplet and the CloudRay dashboard.

TIP

Ensure you have a CloudRay account and obtain your REG_CODE from the project dashboard.

Option 1: New Droplets (via User Data)

When creating a new Droplet, you can use User Data to automatically install and register the CloudRay Agent at first boot.

  1. Go to the DigitalOcean Control Panel
  2. Click Create → Droplet
  3. Under the Advanced Options, locate the User Data section. Then click on Add Initialization scripts
DigitalOcean User Data field
  1. Paste the following script (replace <REG_CODE>):
#!/bin/bash
curl -sSfL https://cloudray.io/install.sh | sudo bash
sudo cloudray-agent install-service --reg-code <REG_CODE>

The install.sh script is safe to run multiple times. It will update the Agent if needed or skip installation if the latest version is already present.

Option 2: Existing Droplets

You can manually install the Agent on running Droplets via SSH.

  1. Connect to your droplet
  2. Run the following commands:
curl -sSfL https://cloudray.io/install.sh | sudo bash
sudo cloudray-agent install-service --reg-code <REG_CODE>
  1. Verify that the instance appears in your CloudRay dashboard under Machines

Alternative: Connect via SSH

If you’re unable to install the CloudRay Agent directly on your server, you can still connect and manage your server via SSH. CloudRay supports executing scripts over a standard SSH connection.

Keep in mind that some advanced functionalities—such as real-time monitoring and task syncing—are only available when the Agent is installed.

To learn more about managing machines using SSH, see the Managing Server SSH Keys documentation.