You can install the CloudRay Agent on Google Cloud Compute Engine (GCE) instances using:

  • Option 1: Automatic installation using Startup Scripts
  • Option 2: Manual installation on existing instances via SSH

The CloudRay Agent enables secure, real-time machines management without relying on external SSH access. It collects system metrics, handles remote tasks, and reports directly to your CloudRay dashboard.

TIP

Make sure you have a CloudRay account and locate your REG_CODE in your project dashboard.

Option 1: New VM (via Startup Script)

You can provide a startup script during VM creation to automate Agent installation and registration.

  1. Navigate to the GCP Console – VM Instances
  2. Click Create Instance
  3. Scroll down to Advanced section find the Automation section.
GCP Startup Script Field
  1. Paste the following shell 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. If the Agent is already installed, it will update if needed or do nothing if the version is current.

  1. Complete the rest of the VM creation process and launch your instance

Option 2: Existing VM Instances

To install the Agent on a running instance:

  1. Connect to your instance using SSH via GCP Console

  2. Run the following commands:

curl -sSfL https://cloudray.io/install.sh | sudo bash
sudo cloudray-agent install-service --reg-code <REG_CODE>
  1. Once installed, visit the CloudRay dashboard, open the Machines section, and confirm that the instance appears as connected.

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 servers using SSH, see the Managing Server SSH Keys documentation.