v52

latestOpenAPI 3.0.0raw.githubusercontent.com2026-08-03269339953.6 KB
VPS: Virtual machine

Setup purchased virtual machine

Setup newly purchased virtual machine with initial state.

Use this endpoint to configure and initialize purchased VPS instances.

post/api/vps/v1/virtual-machines/{virtualMachineId}/setup

Path parameters

virtualMachineIdinteger required
Example:1268054

Virtual Machine ID

Request body

template_idinteger required

Template ID

data_center_idinteger required

Data center ID

post_install_script_idinteger

Post-install script ID

passwordstring password

Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response.

hostnamestring

Override default hostname of the virtual machine

install_monarxboolean

Install Monarx malware scanner (if supported)

enable_backupsboolean

Enable weekly backup schedule

ns1string

Name server 1

ns2string

Name server 2

Example request

{
  "template_id": 1130,
  "data_center_id": 19,
  "post_install_script_id": 6324,
  "password": "oMeNRustosIO",
  "hostname": "my.server.tld",
  "enable_backups": true,
  "ns1": "4.3.2.1",
  "ns2": "1.2.3.4",
  "public_key": {
    "name": "my-key",
    "key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC2X..."
  }
}

Response

Success response

idinteger

Virtual machine ID

firewall_group_idinteger nullable

Active firewall ID, null if disabled

subscription_idstring nullable

Subscription ID

data_center_idinteger nullable

Data center ID

planstring nullable

VPS plan name

hostnamestring
state'running' | 'starting' | 'stopping' | 'stopped' | 'creating' | 'initial' | 'error' | 'suspending' | 'unsuspending' | 'suspended' | 'destroying' | 'destroyed' | 'recreating' | 'restoring' | 'recovery' | 'stopping_recovery'
actions_lock'unlocked' | 'locked'
cpusinteger

CPUs count assigned to virtual machine

memoryinteger

Memory available to virtual machine (in megabytes)

diskinteger

Virtual machine disk size (in megabytes)

bandwidthinteger

Monthly internet traffic available to virtual machine (in megabytes)

ns1string nullable

Primary DNS resolver

ns2string nullable

Secondary DNS resolver

created_atstring date-time

Example response

{
  "id": 17923,
  "subscription_id": "Azz353Uhl1xC54pR0",
  "data_center_id": 521,
  "plan": "KVM 4",
  "hostname": "srv17923.hstgr.cloud",
  "state": "running",
  "actions_lock": "unlocked",
  "cpus": 4,
  "memory": 8192,
  "disk": 51200,
  "bandwidth": 1073741824,
  "ns1": "1.1.1.1",
  "ns2": "8.8.8.8",
  "ipv4": [
    {
      "id": 52347,
      "address": "213.331.273.15",
      "ptr": "something.domain.tld"
    }
  ],
  "ipv6": [
    {
      "id": 52347,
      "address": "213.331.273.15",
      "ptr": "something.domain.tld"
    }
  ],
  "template": {
    "id": 6523,
    "name": "Ubuntu 20.04 LTS",
    "description": "Ubuntu 20.04 LTS",
    "documentation": "https://docs.ubuntu.com"
  },
  "created_at": "2024-09-05T07:25:36.00000Z"
}