A guide explaining how to replace the operating system on your Vultr Optimized Cloud Compute instance.
Changing the instance operating system wipes all data on your server and installs a new file system. This is important when changing the default operating system while preserving the instance's IP and networking information.
Follow this guide to change the operating system on a Vultr Optimized Cloud Compute instance using the Vultr Customer Portal, API, CLI, or Terraform.
Send a GET
request to the List Instances endpoint and note your target instance's ID.
$ curl "https://api.vultr.com/v2/instances" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a GET
request to the List OS endpoint to view all available operating systems and note the target OS ID.
$ curl "https://api.vultr.com/v2/os" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a PATCH
request to the Update Instance endpoint with a new os_id
value to change the instance's operating system.
$ curl "https://api.vultr.com/v2/instances/{instance-id}" \
-X PATCH \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"os_id" : "new-instance-os_id"
}'
List all available instances and note your target instance's ID.
$ vultr-cli instance list
List all available operating systems and note the target OS ID.
$ vultr-cli instance os list <instance-id>
Change the target instance's operating system.
$ vultr-cli instance os change <instance-id> --os <os_id>
Open your Terraform configuration for the existing Optimized Cloud Compute instance.
Update the os_id
value in the instance resource to the new operating system ID.
resource "vultr_instance" "occ" {
# ...existing fields (region, plan, label, etc.)
os_id = 1743 # Example: Ubuntu 22.04 LTS x64
}
Apply the configuration and observe the following output:
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
No comments yet.