Reboot or reset a Compute Engine instance
Stay organized with collections
Save and categorize content based on your preferences.
Linux
Windows
This document explains how to reboot or reset a Compute Engine instance. To
learn more about the effects of resetting an instance, as well as the
differences between suspending, stopping, or resetting an instance, see
Suspend, stop, or reset Compute Engine instances.
Rebooting or resetting an instance can help ensure optimal performance and
stability, or help resolve issues like a frozen, slow, or crashing guest
operating system (OS). Based on the state of the guest OS of your instance, do
one of the following:
Reboot the instance. If your guest OS is slow or frozen, then rebooting
gives it enough time to finish running tasks before shutting down.
Reset the instance. Reset an instance only if the guest OS has crashed
or is unresponsive, and you have no other options. Resetting an instance
doesn't allow the guest OS to cleanly shut down. This action can discard
unsaved data and might corrupt the file systems of any disks.
Before you begin
If you haven't already, set up authentication.
Authentication verifies your identity for access to Google Cloud services and APIs. To run
code or samples from a local development environment, you can authenticate to
Compute Engine by selecting one of the following options:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Google Cloud console to access Google Cloud services and
APIs, you don't need to set up authentication.
gcloud
Install the Google Cloud CLI.
After installation,
initialize the Google Cloud CLI by running the following command:
To use the Go samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the Java samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the Node.js samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the PHP samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
To use the Python samples on this page in a local development environment, install and
initialize the gcloud CLI, and then set up Application Default Credentials with
your user credentials.
This predefined role contains
the permissions required to reset or reboot a compute instance. To see the exact permissions that are
required, expand the Required permissions section:
Required permissions
The following permissions are required to reset or reboot a compute instance:
To reset an instance:
compute.instances.reset
To reboot an instance from within its guest OS:
compute.instances.setMetadata
You can't reset G4 instances that have less than one GPU (fractional GPUs). For
more information about G4 machine types with fractional GPUs (vGPUs), see the
overview of the G4 machine series.
Reboot an instance
Rebooting a compute instance allows the guest OS in the instance to finish
running tasks before Compute Engine sends the ACPI shutdown signal. This
helps to ensure a clean shutdown of the guest OS.
Rebooting an instance erases the memory used by the instance. If you're using
RAM disks with your instances, and you need to preserve that data, then
back up the data
before rebooting the instance.
To reboot an instance, select one of the following options:
Resetting an instance erases all data in the memory of the instance, including
any temporary files stored on RAM disks. This data is permanently lost and
Compute Engine doesn't create backups before resetting the instance.
You can reset multiple instances simultaneously or individual instances. For
multiple instances, use the Google Cloud console or, for instances located in the
same zone, the Google Cloud CLI. For individual instances, select any of the
following options:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-05-15 UTC."],[],[]]