---
title: Startup Script
url: https://docs.vultr.com/products/compute/instances/cloud-gpu/management/startup-script
description: Learn how to modify the startup script on your Vultr Cloud GPU instance to customize its initialization process.
publish_date: 2024-09-23T20:20:09.596486Z
last_updated: 2026-05-26T18:47:50.718447Z
---

# How to Change the Startup Script on a Vultr Cloud GPU Instance

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 default operating system.

Follow this guide to change the startup script on a Vultr Cloud GPU instance using the Vultr Console, or Terraform.

=== "Vultr Console"

    1. Navigate to **Products** and click **Compute**.
    1. Click your target instance to open its management page.
    1. Navigate to the **Settings** tab.
    1. Find and click **Change StartUp Script** on the left navigation menu.
    1. Enter a new script name in the `name` field and click the **Type** drop down to set the script type.
    1. Enter your startup script data in the **Script** field  and click **Add Script** to enable the script on your instance.
    1. Navigate to **Change StartUp Script** in your instance settings to verify that the new script is added.

=== "Terraform"

    1. Open your Terraform configuration for the existing Cloud GPU instance.

    1. 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 GPU instance
        resource "vultr_instance" "gpu" {
            # ...existing fields (region, plan, os_id, label, etc.)

            script_id = vultr_startup_script.init.id
        }
        ```

    1. Apply the configuration and observe the following output:

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