Installing a Snap package

If you prefer automatic updates, you can install the Google Cloud CLI using a snap package on Ubuntu systems. This package contains the gcloud CLI, gcloud alpha, gcloud beta, gsutil, docker-credential-gcloud, and bq commands only. It doesn't include kubectl or the App Engine extensions required to deploy an application using the gcloud CLI. If you need these components, install the Debian package instead.

  1. If you have the old snap package, google-cloud-sdk, installed, remove it at the command line:
    snap remove google-cloud-sdk
    You can't install the new snap package without removing this package because both installations require the same aliases.
  2. At the command line, install the gcloud CLI snap package:
    snapinstallgoogle-cloud-cli--classic
  3. Optional. To add the gcloud CLI tools to your PATH and enable command completion in your Bash shell, source /path/to/gcloud/completion.bash.inc in your profile.

    For Zsh shells, use /path/to/gcloud/completion.zsh.inc instead.

  4. To initialize the gcloud CLI and get started, run gcloud init:
    gcloudinit

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年11月24日 UTC.