Skip to main content
Updated May 8, 2026 This guide walks you through creating a virtual machine, connecting via SSH, and managing its lifecycle.

Prerequisites

  • A Raff account with billing set up
  • An API key (Dashboard → API Keys → Create API Key)
  • A project ID (Dashboard → Projects)
  • An SSH key pair (optional but recommended)

Step 1: Authenticate

Set your API key and project ID as environment variables for convenience:
Verify your access:

Step 2: Create a VM

Create an Ubuntu VM with 2 vCPUs, 4 GB RAM:
Replace <template-uuid> with your OS template ID — get one from List Templates (no auth required; filter with ?category=os).The pricing_id selects a plan that determines vCPU, RAM, storage, and bandwidth — list plans with List VM Pricing.
The response includes your new VM details:

Step 3: Wait for VM to Become Active

Poll the VM status until it becomes active:
The VM transitions through these states in order:

Step 4: Connect via SSH

Once the VM is active, connect using the public IPv4 address:
If you provided a password instead of SSH keys during creation:

Step 5: Manage Your VM

Stop the VM

Stopped VMs retain their resources and IP address. You are still billed for reserved resources.

Resize the VM

Resize requires the VM to be stopped first. Pass a new pricing_id — the plan determines the new vCPU, RAM, storage, and bandwidth. Get plan IDs from List VM Pricing.

Start the VM

Delete the VM

Deleting a VM is permanent. All data on the VM will be lost. Make sure to back up any important data first.

VPC Networking

By default every VM gets a VPC. You can opt out, or share a VPC across multiple VMs.

Auto-created VPC (default)

If you don’t pass any VPC fields, a VPC named vpc-{vm-name} is created automatically and the VM is attached to it. No extra setup required.

Shared VPC

To place multiple VMs on the same private network, create a VPC first, then pass its vpc_id to every VM that should join:

Inline VPC creation

Create the VPC and the first VM in a single call by passing vpc_name and vpc_cidr instead of an existing vpc_id:

Skip the VPC

For a single-VM setup that only needs its public IP, pass skip_vpc: true to opt out of the auto-created VPC entirely. Cannot be combined with skip_public_ip: true — a VM must have at least one network.
Last modified on May 8, 2026