Quickstart for macOS

This page shows how to install the Google Cloud SDK, initialize it, and run core gcloud commands from the command-line.

Before you begin

  1. Create a Google Cloud Platform project, if you don't have one already.

  2. Cloud SDK requires Python. Supported versions are 3.5 to 3.7, and 2.7.9 or higher. To check the Python version installed on your system:

    python -V
  3. Download the archive file best suited to your operating system. Most machines will run the 64-bit package.

    Platform Package Size SHA256 Checksum
    macOS 64-bit


    google-cloud-sdk-304.0.0-darwin-x86_64.tar.gz 79.0 MB 49b716e74890ad0a4198ca6b100561d927e9c87c7aa0d0df279aa2c0c7d90475
    macOS 32-bit


    google-cloud-sdk-304.0.0-darwin-x86.tar.gz 78.0 MB 16d4f8758a171b2ae90cbaa353a9180a1c887b461352600061670ad94613ba25
  4. Extract the archive to any location on your file system; preferably, your home directory. On macOS, this can be achieved by opening the downloaded .tar.gz archive file in the preferred location.

  5. Optional: Use the install script to add Cloud SDK tools to your path. You will also be able to opt-in to command-completion for your bash shell and usage statistics collection during the installation process. Run the script using this command:


    Restart your terminal for the changes to take effect.

    Alternatively, you can call Cloud SDK after extracting the downloaded archive by invoking its executables via the full path.

Initialize the SDK

Use the gcloud init command to perform several common SDK setup tasks. These include authorizing the SDK tools to access Google Cloud Platform using your user account credentials and setting up the default SDK configuration.

To initialize the SDK:

  1. Run the following at a command prompt:

    gcloud init

    Troubleshooting tip: If you encounter an error related to the gcloud command not being found, run ./google-cloud-sdk/install.sh to use the install script; it adds Cloud SDK tools to your PATH. Restart your terminal for the changes to take effect.

  2. Accept the option to log in using your Google user account:

    To continue, you must log in. Would you like to log in (Y/n)? Y
  3. In your browser, log in to your Google user account when prompted and click Allow to grant permission to access Google Cloud Platform resources.

  4. At the command prompt, select a Cloud Platform project from the list of those where you have Owner, Editor or Viewer permissions:

    Pick cloud project to use:
     [1] [my-project-1]
     [2] [my-project-2]
     Please enter your numeric choice:

    If you only have one project, gcloud init selects it for you.

    If you have access to more than 200 projects, you will be prompted to enter a project id, create a new project, or list projects.

    This account has a lot of projects! Listing them all can take a while.
     [1] Enter a project ID
     [2] Create a new project
     [3] List projects
    Please enter your numeric choice:
  5. If you have the Google Compute Engine API enabled, gcloud init allows you to choose a default Compute Engine zone:

    Which compute zone would you like to use as project default?
     [1] [asia-east1-a]
     [2] [asia-east1-b]
     [14] Do not use default zone
     Please enter your numeric choice:

    gcloud init confirms that you have complete the setup steps successfully:

    gcloud has now been configured!
    You can use [gcloud config] to change more gcloud settings.
    Your active configuration is: [default]
  6. (Optional) If you'd like a more streamlined screen reader experience, the gcloud command-line tool comes with an accessibility/screen_reader property.

    To enable this property, run:

    gcloud config set accessibility/screen_reader true

    For more details about the accessibility features that come with the gcloud command-line tool, refer to the Enabling accessibility features guide.

Run core gcloud commands

Run these gcloud commands to view information about your SDK installation:

  1. To list accounts whose credentials are stored on the local system:

    gcloud auth list

    gcloud displays a list of credentialed accounts:

           Credentialed Accounts
    ACTIVE             ACCOUNT
    *                  example-user-1@gmail.com
  2. To list the properties in your active SDK configuration:

    gcloud config list

    gcloud displays the list of properties:

    account = example-user-1@gmail.com
    disable_usage_reporting = False
    project = example-project
  3. To view information about your Cloud SDK installation and the active SDK configuration:

    gcloud info

    gcloud displays a summary of information about your Cloud SDK installation. This includes information about your system, the installed SDK components, the active user account and current project, and the properties in the active SDK configuration.

  4. To view information about gcloud commands and other topics from the command line:

    gcloud help

    For example, to view the help for gcloud compute instances create:

    gcloud help compute instances create

    gcloud displays a help topic that contains a description of the command, a list of command flags and arguments, and examples of how to use it.

What's next

  • Read the gcloud tool guide for an overview of the gcloud command-line tool, including a quick introduction to key concepts, command conventions, and helpful tips.
  • Read the gcloud reference guide for detailed pages on each gcloud command, including descriptions, flags, and examples, that you can use to perform a variety of tasks on Google Cloud Platform.
  • Refer to the gcloud command-line tool cheat sheet for a list of commonly used commands and key concepts.
  • Install additional components such as the App Engine emulators or kubectl using the Cloud SDK component manager.