How to Change the Startup Script on a Vultr Optimized Cloud Compute Instance

Updated on 10 September, 2025

Learn how to modify the startup script that runs when your Vultr instance boots up


Startup scripts allow you to automate specific configurations during the operating system installation. Changing the startup script on an instance wipes the file system and reinstalls the default operating system.

Follow this guide to change the startup script on a Vultr Optimized Cloud Compute instance using the Vultr Customer Portal, or Terraform.

Warning
Changing the startup script on an instance will wipe all data and reinstall the operating system.
  • Vultr Customer Portal
  • Terraform
  1. Navigate to Products and click Compute.
  2. Click your target Vultr Optimized Cloud Compute instance to open its management page.
  3. Navigate to the Settings tab.
  4. Find and click Change StartUp Script on the left navigation menu.
  5. Click Add Startup Script.
  6. Enter a new script name and click the Type drop down to select the script type.
  7. Add your startup script data and click Add Script to apply the script to your instance.
  8. Navigate to Change StartUp Script in your instance settings to verify that the new script is added.
  9. Select the startup script and click Change Startup Script.
  10. Check the confirmation prompt and click Change Startup Script to apply the new script.
  1. Open your Terraform configuration for the existing Optimized Cloud Compute instance.

  2. Create or reference a vultr_startup_script resource and attach it to the instance.

    terraform
    # Create a new startup script
    resource "vultr_startup_script" "init" {
        name = "init-nginx"
        type = "boot"  # boot | pxeboot
        script = <<-EOT
        #!/bin/bash
        apt-get update -y
        apt-get install -y nginx
        systemctl enable --now nginx
        EOT
    }
    
    # Attach the startup script to the instance
    resource "vultr_instance" "occ" {
        # ...existing fields (region, plan, os_id, label, etc.)
    
        script_id = vultr_startup_script.init.id
    }
    
  3. Apply the configuration and observe the following output:

    Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Comments

No comments yet.