Installing a Snap package Stay organized with collections Save and categorize content based on your preferences.
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, andbq command-line tools only. It doesn't includekubectl or the App Engine extensions required to deploy an application using the gcloud CLI. If you need these components, install theDebian package instead.
- If you have the old snap package
google-cloud-sdkinstalled, remove it with the following command: You can't install the new snap package without removing this package because both installations require the same aliases.snap remove google-cloud-sdk
- Install the gcloud CLI snap package:
snapinstallgoogle-cloud-cli--classic
- Optional: To enable command completion, update your profile to source the completion script.
For Bash shells, run the following command:
echo"source /snap/google-cloud-cli/current/completion.bash.inc">>~/.bashrc
For Zsh shells, run the following command:
echo"source /snap/google-cloud-cli/current/completion.zsh.inc">>~/.zshrc
You must restart your shell for this change to take effect.
- Run
gcloud initto initialize, authorize, and configure the gcloud CLI.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-17 UTC.