How to Change the Startup Script on a Vultr Bare Metal Instance

Updated on 11 September, 2025

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


Startup scripts enable you to run specific configurations to automate the operating system installation processes. Changing the startup script on an active instance wipes the file system and reinstalls the operating system.

Follow this guide to change the startup script on a Vultr Bare Metal instance using the Vultr Customer Portal, or Terraform

  • Vultr Customer Portal
  • Terraform
  1. Navigate to Products and click Compute.
  2. Click your target 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. Enter a new script name in the name field and click the Type drop down to set the script type.
  6. Enter your startup script data in the Script field and click Add Script to enable the script on your instance.
  7. Navigate to Change StartUp Script in your instance settings to verify that the new script is added.
  1. Open your Terraform configuration for the existing Bare Metal 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 Bare Metal instance
    resource "vultr_bare_metal_server" "bm1" {
        # ...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.