Setup purchased virtual machine
Setup newly purchased virtual machine with initial state. Use this endpoint to configure and initialize purchased VPS instances.
Setup newly purchased virtual machine with initial state.
Use this endpoint to configure and initialize purchased VPS instances.
API Token authentication
Virtual Machine ID
1268054Template ID
1130Data center ID
19Post-install script ID
6324Password for the virtual machine. If not provided, random password will be generated. Password will not be shown in the response.
oMeNRustosIOOverride default hostname of the virtual machine
my.server.tldInstall Monarx malware scanner (if supported)
falseExample: falseEnable weekly backup schedule
trueExample: trueName server 1
4.3.2.1Name server 2
1.2.3.4Success response
Virtual machine ID
17923Active firewall ID, null if disabled
Subscription ID
Azz353Uhl1xC54pR0Data center ID
521VPS plan name
KVM 4srv17923.hstgr.cloudrunningPossible values: unlockedPossible values: CPUs count assigned to virtual machine
4Memory available to virtual machine (in megabytes)
8192Virtual machine disk size (in megabytes)
51200Monthly internet traffic available to virtual machine (in megabytes)
1073741824Primary DNS resolver
1.1.1.1Secondary DNS resolver
8.8.8.8IPv4 address of virtual machine
IPv6 address of virtual machine, null if not assigned
OS template installed in virtual machine
2024-09-05T07:25:36.00000ZUnauthenticated response
Validation error response
Error response
POST /api/vps/v1/virtual-machines/{virtualMachineId}/setup HTTP/1.1
Host: developers.hostinger.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 284
{
"template_id": 1130,
"data_center_id": 19,
"post_install_script_id": 6324,
"password": "oMeNRustosIO",
"hostname": "my.server.tld",
"install_monarx": false,
"enable_backups": true,
"ns1": "4.3.2.1",
"ns2": "1.2.3.4",
"public_key": {
"name": "my-key",
"key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC2X..."
}
}{
"id": 17923,
"firewall_group_id": null,
"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"
}Last updated
Was this helpful?